# Testumfeld * [[allgemein:test:1.Testseite|1.Testseite]] ====== Diffie-Hellman: Ablaufdiagramm ====== < a2s > .--------------------------------------------------------------------. |[lc] | | Alice Bob Eve (Angreifer) | | | | | | | |--- öffentl. p=23, g=5 -->| | | | | | | | | | a = 6 (geheim) | | | | | A = g^a mod p = 8 | | | | |--- A = 8 --------------->| | | | | | b = 15 (geheim) | | | | | B = g^b mod p = 19 | | | |<-------------- B = 19 ---| | | | | | | | | | s = B^a mod p = 2 | | | | | | s = A^b mod p = 2 | | | | | | | | |----> Gemeinsamer geheimer Schlüssel s = 2 <---------| | | | | | | | | (Eve kennt nur p, g, A, B —> kein Zugriff auf s) | | | | '--------------------------------------------------------------------' [lc]: {"fill":"LemonChiffon","a2s:delref":true} ---- ==== Test 1 ==== < a2s > Shapes : .----------. .----------. .----------. |[cloud] | |[computer]| |[diamond] | | | +->| |<-o->| | | | | | | | | | .----------. | .----------. | .----------. --------------o----------------+ .----------. | .----------. | .----------. |[document]| : |[storage] | | |[printer] | | |<-+->| | | | Some txt | | | | |<-+->| | .----------. .----------. '----------' .----------. .----------. .----------. |[cl] | |[c] | |[yn] | | | +->| |<-o->| | | | | | | | | | .----------. | .----------. | .----------. --------------o----------------+ .----------. | .----------. | .----------. |[d] | : |[st] | | |[p] | | |<-+->| | | | Some txt | | | | |<-+->| | .----------. .----------. '----------' [printer]: {"a2s:type":"printer","fill":"#ff1493"} [computer]: {"a2s:type":"computer"} [cloud]: {"a2s:type":"cloud"} [diamond]: {"a2s:type":"diamond"} [document]: {"a2s:type":"document"} [storage]: {"a2s:type":"storage"} [p]: {"a2s:type":"printer","fill":"cyan","a2s:delref":true} [c]: {"a2s:type":"computer","a2s:delref":true} [cl]: {"a2s:type":"cloud","a2s:delref":true} [yn]: {"a2s:type":"diamond","a2s:delref":true} [d]: {"a2s:type":"document","a2s:delref":true} [st]: {"a2s:type":"storage","a2s:delref":true} ---- ==== Test 2 ==== < a2s > .---------------------------. .----------. |[storage] | |[document]| | STORAGE | | | | | | | | | .----------. | .----------. .---+-------. | |[document]| |[0]|TRANS | | | | | |PARENT | | | | '---+-------' | .----------. | .---------------------------. storage: : document : "fill":"#a7ffbe" : "stroke":"#d627d8" "a2s:delref":true : "stroke-width":9 : "stroke-dasharray":"5 3 3 7 10 5" 5 3 3 7 10 5 .-----. .---. .---. .-------. .----------. .-----. |[r] | | | |[r]| | | |[r] | | | '-----' '---' '---' '-------' '----------' '-----' [document]: {"a2s:type":"document","stroke":"#d627d8","stroke-width":9,"stroke-dasharray":"5 3 3 7 10 5"} [storage]: {"a2s:type":"storage","fill":"#a7ffbe","a2s:delref":true} [0]: {"stroke":"#FFEE49","stroke-width":9,"a2s:delref":true,"fill":"caramba"} [r]: {"fill":"#d627d8","a2s:delref":true} ---- ===== Test 3 ===== Hallo Welt -> > wie ist das Wetter >> Fragst du mich?? > Ja. >> Dann sieh hier nach: curl wttr.in >>> Okay, Danke. >>>> Wichtig hier auch ein Leerzeichen in den Leerzeilen >>>>> >>>>>> >>>>>> Zeile 2 .----. |[e] | -------------+-----+ +----+-------- \ | | / \ | | / \ '----' / \ / \ / \ / \ / + [e]: {"a2s:type":"document", "fill":"lightgreen", "stroke":"blue", "stroke-width":3, "stroke-dasharray":"2 3 2 3 2 3", "a2s:delref":true} < a2s > .====================. .===============++==================++==============. | |.------------------.| | | || TEST || | | |'------------------'| | | '====================' | | | | | '===========================+=======================' | | .-------------------------+------. | | | | | .---+---. | | | v | | | | .+. | | | +->+ +<-+ | | | '-' | | | '----'--' | | .-. | | '-' | | | '--------------------------------' ---- < a2s > .-------------------. | Router / L3-SW | | (Routing Layer 3) | '---------+---------' | +----------------+----------------+ | | .------+--------. .-----+---------. | VLAN 10 | | VLAN 20 | | Marketing | | IT-Abt. | |192.168.10.0/24| |192.168.20.0/24| '--+----+----+--' '--+----+----+--' | | | | | | | | | | | | PC1 PC2 PC3 PC4 PC5 PC6 ==== Test 4 ==== Hier die Rechnung Schritt für Schritt: **Gegeben** * Arbeitsbreite = 520 mm = **52,0 cm** * Bandgeschwindigkeit = **28,00 m/min** * Produktivzeit = **11 h/Tag** * Scanfläche = **52,0 cm × 28,0 cm** * Auflösung = **450 dpi** (dots per inch) * Farbtiefe = **12 Bit** (pro Pixel) * 1 inch = **2,54 cm** --- ### a) Anzahl Scans pro Tag Länge je Scan in Förderrichtung: **28,0 cm = 0,28 m** Scans pro Minute: $\frac{28,00\,\text{m/min}}{0,28\,\text{m}} = 100$ Scans pro Stunde: $100 \times 60 = 6\,000$ Scans pro Tag: $6\,000 \times 11 = \boxed{66\,000}$ --- ### b) Speicherbedarf #### ba) Datenvolumen pro Scan in MiB Pixelanzahl: * Breite in inch: $ \frac{52,0}{2{,}54} = 20{,}4724\,\text{in} \Rightarrow 20{,}4724 \times 450 = 9\,212{,}6\,\text{px}$ * Höhe in inch: $ \frac{28,0}{2{,}54} = 11{,}0236\,\text{in} \Rightarrow 11{,}0236 \times 450 = 4\,960{,}6\,\text{px}$ Gesamtpixel: $9\,212{,}6 \times 4\,960{,}6 \approx 45\,700\,291\,\text{px}$ Datenmenge (12 Bit/Pixel = 1,5 Byte/Pixel): $45\,700\,291 \times 1{,}5 \approx 68\,550\,437\,\text{Byte}$ In MiB (1 MiB = $2^{20}$ Byte): $\frac{68\,550\,437}{1\,048\,576} \approx \boxed{65{,}4\ \text{MiB/Scan}}$ #### bb) Gesamtes Tagesvolumen in TiB (aufrunden) Tagesvolumen: $66\,000 \times 65{,}4 \approx 4\,314\,736\ \text{MiB}$ In TiB (1 TiB = $2^{40}$ Byte): $\frac{4\,314\,736}{1\,048\,576} \approx 4{,}115\ \text{TiB}$ Auf volle TiB aufrunden: **$\boxed{5\ \text{TiB/Tag}}$** > Hinweis (aus der Aufgabe): Nutzt man ersatzweise 90 000 Scans/Tag und 48 MiB/Scan, ergibt sich $90\,000 \times 48 = 4\,320\,000$ MiB ≈ **4,12 TiB**, aufgerundet ebenfalls **5 TiB**. ===== Aufgabe2 ===== ===== Beispielrechnung: Seitenscan ===== **Gegeben:** * Format: 26 × 38 cm * Auflösung: 600 dpi * Umrechnungsfaktor: 2,54 cm/Zoll * Übertragungsrate: 150 Mbit/s ---- **1. Umrechnung in Zoll** * 26 cm ÷ 2,54 ≈ **10,24 Zoll** * 38 cm ÷ 2,54 ≈ **14,96 Zoll** ---- **2. Pixelanzahl berechnen** * 10,24 Zoll × 600 dpi = **6144 px** * 14,96 Zoll × 600 dpi ≈ **8976 px** * Gesamt: 6144 × 8976 ≈ **55.161.600 Pixel** ---- **3. Speicherbedarf** === Farbscan (24 Bit / 3 Byte pro Pixel) === * 55.161.600 × 3 = **165.484.800 Byte** * Umrechnung in MiB: 165.484.800 ÷ 1.048.576 ≈ **157,8 MiB** === Schwarz-Weiß-Scan (1 Bit pro Pixel) === * 55.161.600 × 1 Bit = **55.161.600 Bit** * Umrechnung in Byte: ÷ 8 = **6.895.200 Byte** * Umrechnung in MiB: 6.895.200 ÷ 1.048.576 ≈ **6,6 MiB** ---- **4. Übertragungszeit** * Leitung: 150 Mbit/s = 150.000.000 Bit/s ÷ 8 = **18.750.000 B/s** * In MiB/s: 18.750.000 ÷ 1.048.576 ≈ **17,87 MiB/s** === Farbscan === * Zeit = 157,8 ÷ 17,87 ≈ **8,83 s** * Aufgerundet: **0 Min 09 Sek** === Schwarz-Weiß-Scan === * Zeit = 6,6 ÷ 17,87 ≈ **0,37 s** * Aufgerundet: **0 Min 01 Sek** ---- **Endergebnis:** * Farbscan: **≈ 158 MiB → 0:09 Min:Sek** * SW-Scan: **≈ 6,6 MiB → 0:01 Min:Sek** ---- ==== Programmierung ==== string message = "Die Systemauslastung war an mehr als 18 Stunden höher als 80 %."; // Text Messagebox string title = "MONCPU"; // Titel Messagebox int cpuutil = 0; // Systemauslastung int cpulimit = 0; // Grenzwert der Systemauslastung int sumstd = 0; // Summe Stunden // Array mit Testdaten (24 Stunden) int[] usedCPU = new int[24] { 33,44,40,52,60,56, 33,44,40,52,60,56, 33,44,40,52,60,56, 33,44,40,52,60,56 }; // ---------------- Erweiterung MONCPU ---------------- cpulimit = 80; // Grenzwert festlegen for (int i = 0; i < usedCPU.Length; i++) // alle 24 Stunden prüfen { cpuutil = usedCPU[i]; if (cpuutil > cpulimit) // Stunde über 80 %? { sumstd = sumstd + 1; // Zähler erhöhen } } // Meldung nur ausgeben, wenn mehr als 18 Stunden über 80 % if (sumstd > 18) { MessageBox.Show(message, title); } #include int main() { char message[] = "Die Systemauslastung war an mehr als 18 Stunden höher als 80 %."; char title[] = "MONCPU"; int cpuutil = 0; // einzelne Systemauslastung int cpulimit = 80; // Grenzwert int sumstd = 0; // Zähler für Stunden über 80% // Array mit Testdaten (24 Stunden) int usedCPU[24] = {33,44,40,52,60,56,33,44,40,52,60,56, 33,44,40,52,60,56,33,44,40,52,60,56}; // Alle 24 Stunden prüfen for (int i = 0; i < 24; i++) { cpuutil = usedCPU[i]; if (cpuutil > cpulimit) { sumstd++; } } // Meldung ausgeben, wenn mehr als 18 Stunden über 80 % if (sumstd > 18) { printf("%s\n", message); } return 0; } ---- < a2s > /opt/stacks/vaultwarden/ | +-- .env +-- docker-compose.yml +-- data/ +-- backup/ +-- scripts/