Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Goal
<!-- What does this PR accomplish? 1 sentence. -->

## Changes
-

## Testing
<!-- How did you verify it? -->

## Checklist
- [ ] Title is a clear sentence (≤ 70 chars)
- [ ] Commits are signed (`git log --show-signature`)
- [ ] `submissions/labN.md` updated
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ Thumbs.db
# *.sbom.cdx.json, zap-*.html/json, trivy-*.txt (Lab 9 scan evidence)
# flake.nix, flake.lock (Lab 11)
# wasm/main.go, spin.toml, go.sum (Lab 12)
data/
app/data/
45 changes: 45 additions & 0 deletions evidence/lab4/01-pcap-read.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
18:50:14.556151 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [S], seq 852912346, win 65495, options [mss 65495,sackOK,TS val 2230267369 ecr 0,nop,wscale 10], length 0
E..<..@.@.;.............2.h..........0.........
..-........

18:50:14.556164 IP 127.0.0.1.8080 > 127.0.0.1.52742: Flags [S.], seq 3354113025, ack 852912347, win 65483, options [mss 65495,sackOK,TS val 407459794 ecr 2230267369,nop,wscale 10], length 0
E..<..@.@.<.................2.h......0.........
.IW...-....

18:50:14.556173 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [.], ack 1, win 64, options [nop,nop,TS val 2230267369 ecr 407459794], length 0
E..4..@.@.;.............2.h........@.(.....
..-..IW.
18:50:14.556203 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [P.], seq 1:176, ack 1, win 64, options [nop,nop,TS val 2230267369 ecr 407459794], length 175: HTTP: POST /notes HTTP/1.1
E.....@.@.;6............2.h........@.......
..-..IW.POST /notes HTTP/1.1
Host: localhost:8080
User-Agent: curl/8.5.0
Accept: */*
Content-Type: application/json
Content-Length: 40

{"title":"lab4","body":"packet capture"}
18:50:14.556207 IP 127.0.0.1.8080 > 127.0.0.1.52742: Flags [.], ack 176, win 64, options [nop,nop,TS val 407459794 ecr 2230267369], length 0
E..4.q@.@..P................2.i....@.(.....
.IW...-.
18:50:14.556662 IP 127.0.0.1.8080 > 127.0.0.1.52742: Flags [P.], seq 1:208, ack 176, win 64, options [nop,nop,TS val 407459794 ecr 2230267369], length 207: HTTP: HTTP/1.1 201 Created
E....r@.@...................2.i....@.......
.IW...-.HTTP/1.1 201 Created
Content-Type: application/json
Date: Thu, 06 Aug 2026 15:50:14 GMT
Content-Length: 94

{"id":6,"title":"lab4","body":"packet capture","created_at":"2026-08-06T15:50:14.556405793Z"}

18:50:14.556696 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [.], ack 208, win 64, options [nop,nop,TS val 2230267369 ecr 407459794], length 0
E..4..@.@.;.............2.i........@.(.....
..-..IW.
18:50:14.556827 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [F.], seq 176, ack 208, win 64, options [nop,nop,TS val 2230267369 ecr 407459794], length 0
E..4..@.@.;.............2.i........@.(.....
..-..IW.
18:50:14.556994 IP 127.0.0.1.8080 > 127.0.0.1.52742: Flags [F.], seq 208, ack 177, win 64, options [nop,nop,TS val 407459794 ecr 2230267369], length 0
E..4.s@.@..N................2.i....@.(.....
.IW...-.
18:50:14.557066 IP 127.0.0.1.52742 > 127.0.0.1.8080: Flags [.], ack 209, win 64, options [nop,nop,TS val 2230267370 ecr 407459794], length 0
E..4..@.@.;.............2.i........@.(.....
..-..IW.
93 changes: 93 additions & 0 deletions evidence/lab4/02-diagnostics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
$ ss -tlnp | head -20
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 10 0.0.0.0:7070 0.0.0.0:*
LISTEN 0 50 0.0.0.0:139 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:10808 0.0.0.0:*
LISTEN 0 50 0.0.0.0:445 0.0.0.0:*
LISTEN 0 5 0.0.0.0:902 0.0.0.0:*
LISTEN 0 32 192.168.100.1:53 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:11434 0.0.0.0:*
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 4096 127.0.0.54:53 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:631 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:33357 0.0.0.0:*
LISTEN 0 32 192.168.122.1:53 0.0.0.0:*
LISTEN 0 10 [::]:7070 [::]:*
LISTEN 0 4096 [::1]:631 [::]:*
LISTEN 0 4096 *:8080 *:* users:(("quicknotes",pid=5201,fd=3))
LISTEN 0 50 [::]:139 [::]:*
LISTEN 0 50 [::]:445 [::]:*
LISTEN 0 5 [::]:902 [::]:*

$ ss -tn state established
Recv-Q Send-Q Local Address:Port Peer Address:Port Process
0 0 127.0.0.1:10808 127.0.0.1:49374
0 0 192.168.0.123%enp5s0:40090 192.227.253.103:50000
0 0 127.0.0.1:39186 127.0.0.1:10808
0 0 192.168.0.123%enp5s0:45180 192.227.253.103:50000
0 0 192.168.0.123%enp5s0:52388 192.227.253.103:50000
0 0 192.168.0.123%enp5s0:52400 192.227.253.103:50000
0 0 127.0.0.1:49374 127.0.0.1:10808
0 0 127.0.0.1:10808 127.0.0.1:39186
0 0 10.33.0.2:53448 207.188.6.17:443

$ ip -brief addr
lo UNKNOWN 127.0.0.1/8
enp5s0 UP 192.168.0.123/24
wlx9ca2f49134b7 UP 192.168.0.120/24
virbr0 DOWN 192.168.122.1/24
virbr1 DOWN 192.168.100.1/24
docker0 DOWN 172.17.0.1/16
tun2 UNKNOWN 10.33.0.2/24

$ ip route
default via 192.168.0.1 dev enp5s0 proto dhcp src 192.168.0.123 metric 100
default via 192.168.0.1 dev wlx9ca2f49134b7 proto dhcp src 192.168.0.120 metric 600
1.0.0.0/8 via 10.33.0.2 dev tun2
1.0.0.1 via 10.33.0.2 dev tun2
2.0.0.0/7 via 10.33.0.2 dev tun2
4.0.0.0/6 via 10.33.0.2 dev tun2
8.0.0.0/5 via 10.33.0.2 dev tun2
10.33.0.0/24 dev tun2 proto kernel scope link src 10.33.0.2
16.0.0.0/4 via 10.33.0.2 dev tun2
32.0.0.0/3 via 10.33.0.2 dev tun2
64.0.0.0/2 via 10.33.0.2 dev tun2
127.0.0.0/8 dev lo proto kernel scope link src 127.0.0.1 metric 30
128.0.0.0/1 via 10.33.0.2 dev tun2
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.29.172.254 via 10.33.0.2 dev tun2
192.168.0.0/24 dev enp5s0 proto kernel scope link src 192.168.0.123 metric 100
192.168.0.0/24 dev wlx9ca2f49134b7 proto kernel scope link src 192.168.0.120 metric 600
192.168.100.0/24 dev virbr1 proto kernel scope link src 192.168.100.1 linkdown
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

$ dig +short localhost
127.0.0.1

$ dig localhost | head -20

; <<>> DiG 9.18.39-0ubuntu0.24.04.5-Ubuntu <<>> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18509
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;localhost. IN A

;; ANSWER SECTION:
localhost. 0 IN A 127.0.0.1

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Aug 06 18:52:47 MSK 2026
;; MSG SIZE rcvd: 54


$ getent hosts localhost
127.0.0.1 localhost

$ curl -s -o /dev/null -w "dns=%{time_namelookup} connect=%{time_connect} total=%{time_total}\n" http://localhost:8080/health
dns=0.000031 connect=0.000240 total=0.000772
26 changes: 26 additions & 0 deletions evidence/lab4/03-path.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$ mtr -rwc 5 localhost
Start: 2026-08-06T18:53:36+0300
HOST: hns Loss% Snt Last Avg Best Wrst StDev
1.|-- localhost 0.0% 5 0.1 0.1 0.1 0.1 0.0

$ ip link show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

$ cat /proc/sys/net/ipv4/tcp_congestion_control
cubic

$ ss -tim state established dst 127.0.0.1 | head -20
Recv-Q Send-Q Local Address:Port Peer Address:Port Process
0 0 127.0.0.1:10808 127.0.0.1:49374
skmem:(r0,rb170241,t0,tb2626560,f0,w0,o0,bl0,d6) cubic wscale:10,10 rto:201 rtt:0.601/0.329 ato:40 mss:65483 pmtu:65535 rcvmss:20480 advmss:65483 cwnd:27 bytes_sent:1645335 bytes_acked:1645335 bytes_received:1146513 segs_out:585 segs_in:386 data_segs_out:493 data_segs_in:112 send 23.5Gbps lastsnd:31928 lastrcv:34024 lastack:31928 pacing_rate 47Gbps delivery_rate 74.8Gbps delivered:494 app_limited busy:988ms rcv_rtt:640.625 rcv_space:70448 rcv_ssthresh:161157 minrtt:0.007 snd_wnd:325632
0 0 127.0.0.1:10808 127.0.0.1:35028
skmem:(r0,rb131072,t0,tb2626560,f0,w0,o0,bl0,d1) cubic wscale:10,10 rto:206 rtt:5.112/10.083 ato:40 mss:32768 pmtu:65535 rcvmss:536 advmss:65483 cwnd:10 bytes_sent:12 bytes_acked:12 bytes_received:13 segs_out:4 segs_in:7 data_segs_out:2 data_segs_in:2 send 513Mbps lastsnd:32576 lastrcv:32576 lastack:32535 pacing_rate 1.03Gbps delivery_rate 3.45Gbps delivered:3 app_limited busy:41ms rcv_space:65483 rcv_ssthresh:65483 minrtt:0.076 snd_wnd:65536
0 0 127.0.0.1:35028 127.0.0.1:10808
skmem:(r0,rb131072,t0,tb2626560,f0,w0,o0,bl0,d0) cubic wscale:10,10 rto:201 rtt:0.133/0.047 ato:40 mss:32768 pmtu:65535 rcvmss:536 advmss:65483 cwnd:10 bytes_sent:13 bytes_acked:14 bytes_received:12 segs_out:7 segs_in:5 data_segs_out:2 data_segs_in:2 send 19.7Gbps lastsnd:32578 lastrcv:32578 lastack:2113 pacing_rate 39.2Gbps delivery_rate 2.57Gbps delivered:3 app_limited rcv_space:65495 rcv_ssthresh:65495 minrtt:0.102 snd_wnd:65536
0 0 127.0.0.1:39186 127.0.0.1:10808
skmem:(r0,rb131072,t0,tb2626560,f0,w0,o0,bl0,d0) cubic wscale:10,10 rto:203 rtt:2.618/5.187 ato:40 mss:34304 pmtu:65535 rcvmss:1391 advmss:65483 cwnd:10 bytes_sent:2311 bytes_acked:2312 bytes_received:1680 segs_out:29 segs_in:32 data_segs_out:8 data_segs_in:7 send 1.05Gbps lastsnd:520092 lastrcv:519745 lastack:6210 pacing_rate 2.1Gbps delivery_rate 19.6Gbps delivered:9 app_limited busy:42ms rcv_space:65495 rcv_ssthresh:76663 minrtt:0.014 snd_wnd:68608
0 0 127.0.0.1:49374 127.0.0.1:10808
skmem:(r0,rb410514,t0,tb2626560,f0,w0,o0,bl0,d0) cubic wscale:10,10 rto:201 rtt:0.256/0.421 ato:40 mss:65483 pmtu:65535 rcvmss:8568 advmss:65483 cwnd:10 bytes_sent:1146513 bytes_acked:1146514 bytes_received:1645335 segs_out:386 segs_in:586 data_segs_out:112 data_segs_in:493 send 20.5Gbps lastsnd:34029 lastrcv:31933 lastack:1603 pacing_rate 40.9Gbps delivery_rate 105Gbps delivered:113 app_limited busy:210ms rcv_rtt:16 rcv_space:134229 rcv_ssthresh:351181 minrtt:0.005 snd_wnd:161792
0 0 127.0.0.1:10808 127.0.0.1:39186
skmem:(r0,rb131072,t0,tb2626560,f0,w0,o0,bl0,d17) cubic wscale:10,10 rto:202 rtt:1.9/2.611 ato:40 mss:38400 pmtu:65535 rcvmss:1085 advmss:65483 cwnd:10 bytes_sent:1680 bytes_acked:1680 bytes_received:2311 segs_out:31 segs_in:29 data_segs_out:7 data_segs_in:8 send 1.62Gbps lastsnd:519749 lastrcv:520096 lastack:519749 pacing_rate 3.23Gbps delivery_rate 16.2Gbps delivered:8 app_limited busy:18ms rcv_rtt:4 rcv_space:65483 rcv_ssthresh:68534 minrtt:0.019 snd_wnd:76800
13 changes: 13 additions & 0 deletions evidence/lab4/04-refused.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$ curl -sv http://localhost:9999/health
* Host localhost:9999 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:9999...
* Immediate connect fail for ::1: Невозможно назначить запрошенный адрес
* Trying 127.0.0.1:9999...
* connect to 127.0.0.1 port 9999 from 127.0.0.1 port 58714 failed: В соединении отказано
* Failed to connect to localhost port 9999 after 0 ms: Couldn't connect to server
* Closing connection

$ ss -tln sport = :9999
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
33 changes: 33 additions & 0 deletions evidence/lab4/05-latency.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$ 20 последовательных запросов, тайминги
0.000349 0.000828 0.000901
0.000365 0.000775 0.000841
0.000207 0.000502 0.000542
0.000255 0.000540 0.000604
0.000139 0.000299 0.000324
0.000157 0.000355 0.000385
0.000129 0.000285 0.000309
0.000124 0.000271 0.000295
0.000119 0.000260 0.000282
0.000128 0.000273 0.000298
0.000107 0.000231 0.000250
0.000119 0.000283 0.000304
0.000110 0.000246 0.000266
0.000128 0.000283 0.000307
0.000098 0.000203 0.000221
0.000110 0.000232 0.000252
0.000107 0.000231 0.000254
0.000111 0.000279 0.000299
0.000091 0.000213 0.000233
0.000086 0.000181 0.000196

$ ss -s
Total: 972
TCP: 49 (estab 10, closed 21, orphaned 0, timewait 21)

Transport Total IP IPv6
RAW 3 1 2
UDP 39 35 4
TCP 28 22 6
INET 70 58 12
FRAG 0 0 0

3 changes: 3 additions & 0 deletions evidence/lab4/06-broken-deploy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2026/08/06 18:55:51 quicknotes listening on :8080 (notes loaded: 6)
2026/08/06 18:55:51 listen: listen tcp :8080: bind: address already in use
exit status 1
19 changes: 19 additions & 0 deletions evidence/lab4/07-triage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=== 1. Симптом: клиент не может подключиться к новому инстансу ===
$ curl -sv --max-time 3 http://localhost:8080/health
{"notes":6,"status":"ok"}


=== 2. Кто занимает порт 8080 ===
$ ss -tlnp sport = :8080
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 4096 *:8080 *:* users:(("quicknotes",pid=5201,fd=3))

=== 3. Что это за процесс ===
$ ps -p 5201 -o pid,ppid,etime,cmd
PID PPID ELAPSED CMD
5201 5094 09:29 /tmp/go-build2908606575/b001/exe/quicknotes

=== 4. Когда он стартовал ===
$ ls -la /proc/5201/cwd
lrwxrwxrwx 1 hns hns 0 авг 6 18:56 /proc/5201/cwd -> /home/hns/dev/DevOps-Intro/app
lrwxrwxrwx 1 hns hns 0 авг 6 18:56 /proc/5201/cwd -> /home/hns/dev/DevOps-Intro/app
14 changes: 14 additions & 0 deletions evidence/lab4/08-fix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=== Fix: остановить старый инстанс ===
$ kill 5201
$ ss -tlnp sport = :8080 (порт должен освободиться)
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
(пусто = порт свободен)

=== Recovery: новый инстанс поднят ===
$ ss -tlnp sport = :8080
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 4096 *:8080 *:* users:(("quicknotes",pid=5820,fd=3))

$ curl -s http://localhost:8080/health
{"notes":6,"status":"ok"}

Binary file added evidence/lab4/quicknotes.pcap
Binary file not shown.
Loading