Add network unit 24 on ARP and RARP address resolution.

Cover IP/MAC conversion, broadcast queries, replies and ARP cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-14 13:06:33 +02:00
commit 0897f5f194
5 changed files with 138 additions and 18 deletions

View file

@ -31,7 +31,7 @@ GTK 4 interface.
German learning path
- **Správa počítačových sítí / Computer Network Administration** is open too
(shown with a Wi-Fi icon) and leads to a 30-unit computer-networks path;
**units 1–23 are playable**, units 24–30 are locked placeholders
**units 1–24 are playable**, units 25–30 are locked placeholders
- **Technické vybavení / Computer Hardware** is open (chip icon) and leads
to a 10-unit hardware path; **units 1–3 are playable**, units 4–10 are
locked placeholders
@ -62,7 +62,7 @@ GTK 4 interface.
- **Hints & model answers** – in exercises where you write or complete a German
sentence the Czech meaning is shown right away as a hint, and clicking the
check button also reveals the correct German sentence so you can compare
- **Computer networks path** – twenty-three unlocked units (theory slides + practice):
- **Computer networks path** – twenty-four unlocked units (theory slides + practice):
1. **Výpočet IP adres / IP Address Calculation** – 4-slide VLSM walkthrough
and four interactive subnetting tasks (prefix, network, broadcast, host
range) with check and “show solution”
@ -88,6 +88,7 @@ GTK 4 interface.
21. Adresy a rámce v ethernetu – slides + quiz
22. Paket IP – slides + quiz
23. ICMP – slides + quiz
24. ARP – slides + quiz
Progress for networks is saved to `progress/net.conf` (one flag per unit);
completed network units show a checkmark on the path and count in Statistics
- **Computer hardware path** – three unlocked units (theory slides + quiz):
@ -310,11 +311,11 @@ When launched, the application shows the welcome screen. From there:
unit 2 or **"Bei uns zu Hause"** for unit 3, then pick any bubble to start
an exercise. Units 2 and 3 are available even if the earlier units are not
finished yet.
5. On the networks path, units **1–23** are open. Unit 1 (**Výpočet IP adres**)
5. On the networks path, units **1–24** are open. Unit 1 (**Výpočet IP adres**)
walks through four VLSM slides and then four interactive subnetting tasks
with check / “show solution”. Units 2–23 each have theory slides followed by
a multiple-choice quiz (basic concepts through ICMP).
Units 24–30 stay locked placeholders.
with check / “show solution”. Units 2–24 each have theory slides followed by
a multiple-choice quiz (basic concepts through ARP).
Units 25–30 stay locked placeholders.
6. On the hardware path, units **1–3** are open (architecture / von Neumann,
computer history generations, bit & byte), each with slides and a quiz.
Units 4–10 stay locked.
@ -465,7 +466,7 @@ moderním GTK 4 rozhraním stylovaným přes CSS.
- **Deutsch** je otevřený (bublina s německou vlajkou) a vede na německou
učební cestu
- **Správa počítačových sítí** je také otevřená (ikona Wi‑Fi) a vede na cestu
s 30 jednotkami; **jednotky 1–23 jsou hratelné**, 24–30 jsou zamčené
s 30 jednotkami; **jednotky 1–24 jsou hratelné**, 25–30 jsou zamčené
placeholdery
- **Technické vybavení** je otevřené (ikona čipu) a vede na cestu
s 10 jednotkami; **jednotky 1–3 jsou hratelné**, 4–10 jsou zamčené
@ -491,7 +492,7 @@ moderním GTK 4 rozhraním stylovaným přes CSS.
„Was siehst du?“, řazení vět, chybějící písmena)
- **Nápovědy a vzorové odpovědi** – u psaných / doplňovaných vět je hned
český význam; po kontrole se ukáže i správná německá věta
- **Cesta počítačových sítí** – třiadvacet odemčených jednotek (snímky + cvičení):
- **Cesta počítačových sítí** – čtyřiadvacet odemčených jednotek (snímky + cvičení):
1. **Výpočet IP adres** – 4 snímky VLSM a čtyři interaktivní úlohy
(prefix, síť, broadcast, rozsah uzlů) s kontrolou a „ukázat řešení“
2. Základní pojmy a rozdělení sítí – snímky + kvíz
@ -516,6 +517,7 @@ moderním GTK 4 rozhraním stylovaným přes CSS.
21. Adresy a rámce v ethernetu – snímky + kvíz
22. Paket IP – snímky + kvíz
23. ICMP – snímky + kvíz
24. ARP – snímky + kvíz
Postup u sítí se ukládá do `progress/net.conf` (příznak na jednotku);
dokončené jednotky mají fajfku na cestě a počítají se ve Statistikách
- **Cesta technického vybavení** – tři odemčené jednotky (snímky + kvíz):
@ -736,10 +738,10 @@ Po spuštění se zobrazí úvodní obrazovka. Odtud:
4. Otevřete **"Neue Freunde"** (jednotka 1), **"Aus aller Welt"** (2) nebo
**"Bei uns zu Hause"** (3) a vyberte bublinu cvičení. Jednotky 2 a 3 jdou
otevřít i bez dokončení předchozích.
5. Na síťové cestě jsou otevřené jednotky **1–23**. Jednotka 1 (**Výpočet IP
5. Na síťové cestě jsou otevřené jednotky **1–24**. Jednotka 1 (**Výpočet IP
adres**) má 4 snímky VLSM a pak 4 interaktivní úlohy s kontrolou /
„ukázat řešení“. Jednotky 2–23 mají snímky teorie a kvíz s výběrem
(od základních pojmů po ICMP). Jednotky 24–30 zůstávají zamčené.
„ukázat řešení“. Jednotky 2–24 mají snímky teorie a kvíz s výběrem
(od základních pojmů po ARP). Jednotky 25–30 zůstávají zamčené.
6. Na cestě technického vybavení jsou otevřené jednotky **1–3** (architektura /
von Neumann, historie generací, bit a byte), každá se snímky a kvízem.
Jednotky 4–10 zůstávají zamčené.
@ -783,8 +785,8 @@ exercise_u1.c cvičení jednotky 1 („Neue Freunde“)
exercise_u2.c cvičení jednotky 2 („Aus aller Welt“)
exercise_u3.c cvičení jednotky 3 („Bei uns zu Hause“)
settings.c panel nastavení (režim, téma, jazyk)
net.c cesta počítačových sítí (30 uzlů), jednotky 1–23
(1: VLSM cvičení; 2–23: kvízy s výběrem)
net.c cesta počítačových sítí (30 uzlů), jednotky 1–24
(1: VLSM cvičení; 2–24: kvízy s výběrem)
hw.c cesta technického vybavení (10 uzlů), jednotky 1–3
(architektura, historie, bit/byte + kvízy)
main.c vstupní bod aplikace a zapojení stránek

20
i18n.c
View file

@ -335,6 +335,12 @@ const TrEntry tr_ui[] = {
"5 slides about ICMP messages and traceroute, then a quiz."},
{"net_ex23_title", "Kvíz: ICMP",
"Quiz: ICMP"},
{"net_unit24", "ARP",
"ARP"},
{"net_unit24_sub", "5 snímků o ARP/RARP a cache a pak kvíz.",
"5 slides about ARP/RARP and cache, then a quiz."},
{"net_ex24_title", "Kvíz: ARP",
"Quiz: ARP"},
{"net_quiz_intro",
"Vyberte u každé otázky jednu správnou odpověď a stiskněte Zkontrolovat.",
"Choose one correct answer for each question and press Check."},
@ -382,6 +388,8 @@ const TrEntry tr_ui[] = {
"Quiz on the IP packet"},
{"net_quiz23_head", "Kvíz k ICMP",
"Quiz on ICMP"},
{"net_quiz24_head", "Kvíz k ARP",
"Quiz on ARP"},
{"net_slide_next", "Další", "Next"},
{"net_slide_prev", "Zpět", "Back"},
{"net_slide_start", "Přejít na cvičení", "Go to the exercise"},
@ -742,6 +750,18 @@ const TrEntry tr_content[] = {
"Echo Request/Reply = ping"},
{"Traceroute zvyšuje TTL a čte Time Exceeded", NULL,
"Traceroute raises TTL and reads Time Exceeded"},
{"ARP: IP → MAC", NULL,
"ARP: IP → MAC"},
{"RARP: MAC → IP", NULL,
"RARP: MAC → IP"},
{"Nejčastější je dynamický dotaz a odpověď", NULL,
"The most common way is a dynamic query and reply"},
{"ARP dotaz jde broadcastem", NULL,
"An ARP request goes out as a broadcast"},
{"ARP odpověď je unicast s MAC", NULL,
"An ARP reply is a unicast with the MAC"},
{"ARP cache ukládá výsledky dočasně (arp -a)", NULL,
"ARP cache stores results temporarily (arp -a)"},
{"čtrnáct", NULL, "fourteen"},
{"sedmnáct", NULL, "seventeen"},
{"dvacet", NULL, "twenty"},

1
main.c
View file

@ -269,6 +269,7 @@ void activate(GtkApplication *app, gpointer user_data) {
{"netunit21", "netex21", build_net_unit21_page, build_net_unit21_exercise_page},
{"netunit22", "netex22", build_net_unit22_page, build_net_unit22_exercise_page},
{"netunit23", "netex23", build_net_unit23_page, build_net_unit23_exercise_page},
{"netunit24", "netex24", build_net_unit24_page, build_net_unit24_exercise_page},
};
for (guint i = 0; i < G_N_ELEMENTS(net_pages); i++) {

View file

@ -72,7 +72,8 @@
#define NET21_SLIDES 8
#define NET22_SLIDES 8
#define NET23_SLIDES 5
#define NET_LESSONS 23
#define NET24_SLIDES 5
#define NET_LESSONS 24
#define HW_UNITS 10
#define HW_LESSONS 3
#define HW_SLIDES 3
@ -1109,6 +1110,7 @@ GtkWidget *build_net_unit20_page(void);
GtkWidget *build_net_unit21_page(void);
GtkWidget *build_net_unit22_page(void);
GtkWidget *build_net_unit23_page(void);
GtkWidget *build_net_unit24_page(void);
GtkWidget *net_qz_combo(void);
void net_qz_set_prefix(GtkComboBoxText *c, int pfx);
int net_qz_prefix(GtkComboBoxText *c);
@ -1145,6 +1147,7 @@ GtkWidget *build_net_unit20_exercise_page(void);
GtkWidget *build_net_unit21_exercise_page(void);
GtkWidget *build_net_unit22_exercise_page(void);
GtkWidget *build_net_unit23_exercise_page(void);
GtkWidget *build_net_unit24_exercise_page(void);
void activate(GtkApplication *app, gpointer user_data);
int main(int argc, char **argv);

98
net.c
View file

@ -5,7 +5,7 @@
NetLesson net_lessons[NET_LESSONS] = {
/* UI unit N maps to lesson content: unit 1 = IP/VLSM (extra);
* units 2–23 = source topics (Základní pojmy … ICMP). */
* units 2–24 = source topics (Základní pojmy … ARP). */
{ .n_slides = NET_SLIDES, .unit_page = "netunit1", .ex_page = "netex1" },
{ .n_slides = NET2_SLIDES, .unit_page = "netunit2", .ex_page = "netex2" },
{ .n_slides = NET3_SLIDES, .unit_page = "netunit3", .ex_page = "netex3" },
@ -29,6 +29,7 @@ NetLesson net_lessons[NET_LESSONS] = {
{ .n_slides = NET21_SLIDES, .unit_page = "netunit21", .ex_page = "netex21" },
{ .n_slides = NET22_SLIDES, .unit_page = "netunit22", .ex_page = "netex22" },
{ .n_slides = NET23_SLIDES, .unit_page = "netunit23", .ex_page = "netex23" },
{ .n_slides = NET24_SLIDES, .unit_page = "netunit24", .ex_page = "netex24" },
};
void net_paragraph(GtkWidget *box, const char *text) {
@ -471,7 +472,7 @@ void net_add_node(GtkFixed *fixed, int index) {
"net_unit6", "net_unit7", "net_unit8", "net_unit9", "net_unit10",
"net_unit11", "net_unit12", "net_unit13", "net_unit14", "net_unit15",
"net_unit16", "net_unit17", "net_unit18", "net_unit19", "net_unit20",
"net_unit21", "net_unit22", "net_unit23"
"net_unit21", "net_unit22", "net_unit23", "net_unit24"
};
card = gtk_button_new();
@ -2039,6 +2040,62 @@ GtkWidget *build_net_unit23_page(void) {
slides, NET23_SLIDES);
}
GtkWidget *build_net_unit24_page(void) {
static const NetSlide slides[NET24_SLIDES] = {
{
"1 / 5 • ARP / RARP", "Převod adres",
NULL,
{
"ARP: z IP adresy na MAC (fyzickou) adresu.",
"RARP: z MAC adresy na IP adresu.",
NULL,
},
},
{
"2 / 5 • Způsoby", "Jak zjistit MAC",
NULL,
{
"Tabulkový převod: ruční správa (malé sítě).",
"Výpočet: funkce, kde MAC plyne z IP.",
"Dotaz a odpověď: dynamické zjišťování (nejčastější).",
NULL,
},
},
{
"3 / 5 • Mechanismus", "Broadcast a unicast",
"Tip: „Kdo má IP x.x.x.x?“",
{
"ARP využívá broadcast v Ethernetu.",
"Odpoví jen uzel s danou IP.",
"Odpověď jde unicastem a obsahuje MAC adresu.",
NULL,
},
},
{
"4 / 5 • Cache", "Dočasná paměť",
"Tip: zobrazení příkazem arp -a",
{
"Výsledky se ukládají do ARP cache.",
"Dotazy se tak nemusí stále opakovat.",
"Položky: dynamické (učené) nebo statické (ruční).",
NULL,
},
},
{
"5 / 5 • Shrnutí", "K čemu ARP slouží",
NULL,
{
"Propojuje síťovou adresu (IP) s linkovou (MAC).",
"Bez ARP by IP datagram nešel vložit do Ethernet rámce.",
NULL,
},
},
};
return build_net_unit_page(&net_lessons[23], "net_unit24", "net_unit24_sub",
slides, NET24_SLIDES);
}
/* Solutions below are the canonical "largest subnet first, in order A–D"
* allocation. Scenario 3 does not fit into a /24 as written, which is why
* its "solution" explains that instead. */
@ -3443,3 +3500,40 @@ GtkWidget *build_net_unit23_exercise_page(void) {
(int)G_N_ELEMENTS(net23_qs));
}
const ChoiceQ net24_qs[] = {
{"ARP převádí:",
{"IP adresu na MAC adresu", "MAC adresu na IP adresu",
"TCP na UDP", "TTL na MTU"}, 4, 0},
{"RARP převádí:",
{"MAC adresu na IP adresu", "IP adresu na MAC adresu",
"EtherType na SAP", "OSPF na RIP"}, 4, 0},
{"Nejčastější způsob ARP je:",
{"Dotaz a odpověď v síti", "Jen ruční tabulka bez sítě",
"Jen cut-through", "Jen ICMP Echo"}, 4, 0},
{"ARP dotaz v Ethernetu používá:",
{"Broadcast", "Jen unicast bez broadcastu", "Jen laser",
"Jen Token Ring bez IP"}, 4, 0},
{"ARP odpověď typicky přichází jako:",
{"Unicast s MAC adresou uzlu", "Broadcast bez MAC",
"Jen Time Exceeded", "Jen Source Quench"}, 4, 0},
{"ARP cache slouží k tomu, aby:",
{"Se nemusely stále opakovat stejné dotazy",
"Se nahradil směrovač", "Se zrušila IP adresa",
"Se vypnul Ethernet"}, 4, 0},
};
const char *net24_hints[] = {
"ARP: IP → MAC",
"RARP: MAC → IP",
"Nejčastější je dynamický dotaz a odpověď",
"ARP dotaz jde broadcastem",
"ARP odpověď je unicast s MAC",
"ARP cache ukládá výsledky dočasně (arp -a)",
};
GtkWidget *build_net_unit24_exercise_page(void) {
return build_net_mcq_page(23, "netunit24", "net_ex24_title", "net_quiz24_head",
net24_qs, net24_hints,
(int)G_N_ELEMENTS(net24_qs));
}