Opening and closing TCP connections
On this page
In Following an exchange, you left some rows before and after the request unexplained. They contain no page words, yet belong to the same conversation. Read those rows to see how laptop and web agree to talk, check which bytes arrived, and finish.
Before you start
Section titled “Before you start”Finish Processes, sockets, and ports. Keep modes off, leave machine shells and run netlab reset from the VM if needed. Open two terminals on laptop with netlab shell laptop. Start the listener before sending. Type your Ubuntu password when sudo asks; nothing appears while you type it.
Open before asking for the file
Section titled “Open before asking for the file”In terminal 1 run sudo tcpdump -n -i eth0 tcp port 80. This filter selects TCP traffic involving port 80. In terminal 2 run curl -sS http://10.77.20.80/hello.txt. Return to the listener and press Ctrl+C after curl finishes.
learner@laptop:~$ sudo tcpdump -n -i eth0 tcp port 80[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes08:25:31.710723 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [S], seq 1205958452, win 64240, options [mss 1460,sackOK,TS val 306269755 ecr 0,nop,wscale 10], length 0
08:25:31.710768 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [S.], seq 1661005969, ack 1205958453, win 65160, options [mss 1460,sackOK,TS val 4281951379 ecr 306269755,nop,wscale 10], length 0
08:25:31.710776 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 0
08:25:31.711008 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 83: HTTP: GET /hello.txt HTTP/1.1
08:25:31.711056 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 84, win 64, options [nop,nop,TS val 4281951379 ecr 306269755], length 0
08:25:31.714454 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 4281951382 ecr 306269755], length 172: HTTP: HTTP/1.0 200 OK
08:25:31.714486 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 306269758 ecr 4281951382], length 0
08:25:31.715103 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269758], length 16: HTTP
08:25:31.715127 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0
08:25:31.715161 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0
08:25:31.715234 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0
08:25:31.715281 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 85, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (10)
- Type
sudo tcpdump -n -i eth0 tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - The second terminal finished. Return here and press Ctrl+C to stop listening.
- Output:
08:25:31.710723 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [S], seq 1205958452, win 64240, options [mss 1460,sackOK,TS val 306269755 ecr 0,nop,wscale 10], length 0 08:25:31.710768 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [S.], seq 1661005969, ack 1205958453, win 65160, options [mss 1460,sackOK,TS val 4281951379 ecr 306269755,nop,wscale 10], length 0 08:25:31.710776 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 0 08:25:31.711008 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 83: HTTP: GET /hello.txt HTTP/1.1 08:25:31.711056 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 84, win 64, options [nop,nop,TS val 4281951379 ecr 306269755], length 0 08:25:31.714454 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 4281951382 ecr 306269755], length 172: HTTP: HTTP/1.0 200 OK 08:25:31.714486 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 306269758 ecr 4281951382], length 0 08:25:31.715103 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269758], length 16: HTTP 08:25:31.715127 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0 08:25:31.715161 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0 08:25:31.715234 IP 10.77.10.10.45326 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0 08:25:31.715281 IP 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 85, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0 - Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS http://10.77.20.80/hello.txtHello from web.learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/hello.txt - Press Enter
- Output:
Hello from web.
TCP, the Transmission Control Protocol, delivers bytes from one program to the other in order and notices when some are missing. A connection is the record both ends keep while they talk. A handshake is the opening exchange that sets up the connection.
The first row has SYN, a request to start and agree on the starting numbers. Tcpdump writes it as S. Web answers with SYN and ACK, an acknowledgment of what it has received. Tcpdump uses a dot, ., for ACK, so this row shows [S.]. Laptop’s third row is [.]: acknowledgment alone.
Open, then send data
- laptop10.77.10.10
- web10.77.20.80
- SYN: laptop to web
- SYN and ACK: web to laptop
- ACK: laptop to web
- Request bytes: laptop to web
In the capture4 messages at laptop:eth0
- 1. SYN
08:25:31.710724 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.45326 > 10.77.20.80.80: Flags [S], seq 1205958452, win 64240, options [mss 1460,sackOK,TS val 306269755 ecr 0,nop,wscale 10], length 0 - 2. SYN and ACK
08:25:31.710768 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.45326: Flags [S.], seq 1661005969, ack 1205958453, win 65160, options [mss 1460,sackOK,TS val 4281951379 ecr 306269755,nop,wscale 10], length 0 - 3. ACK
08:25:31.710776 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 0 - 4. Request bytes
08:25:31.711009 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.45326 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 83: HTTP: GET /hello.txt HTTP/1.1
curl -sS http://10.77.20.80/hello.txt, on Ubuntu 24.04.5 LTS, netlab 1.0, tcpdump 4.99.4. The values are the capture's. The opening and first data segment share one laptop-link capture with IP-address lanes naming the endpoints and routers omitted.Machines by IP address; captured at laptop:eth0. Routers on the path are not drawn.Steps (4)
Machines by IP address; captured at laptop:eth0. Routers on the path are not drawn.
- SYN. laptop to web. Laptop asks to start. The data length is zero.
08:25:31.710724 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.45326 > 10.77.20.80.80: Flags [S], seq 1205958452, win 64240, options [mss 1460,sackOK,TS val 306269755 ecr 0,nop,wscale 10], length 0 - SYN and ACK. web to laptop. Web agrees to start and acknowledges laptop’s SYN.
08:25:31.710768 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.45326: Flags [S.], seq 1661005969, ack 1205958453, win 65160, options [mss 1460,sackOK,TS val 4281951379 ecr 306269755,nop,wscale 10], length 0 - ACK. laptop to web. Laptop acknowledges web’s SYN. No request bytes have been sent yet.
08:25:31.710776 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.45326 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 0 - Request bytes. laptop to web. The first request bytes follow the opening. The data length is positive.
08:25:31.711009 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.45326 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 306269755 ecr 4281951379], length 83: HTTP: GET /hello.txt HTTP/1.1
The first three messages have zero data bytes. The request comes afterward. In the stage, the ports tell you who is talking. The flags show what each end is doing. Data length tells you whether the row carries application bytes.
Notice which bytes were received
Section titled “Notice which bytes were received”The listener’s next [P.] row carries the request. P marks the push flag; this row carries data, but a push flag does not tell you where an application message ends. The dot still means ACK.
Find seq 1:84 and length 83 in that row. Tcpdump displays later sequence values relative to the start: bytes numbered 1 through 83 are being sent. The last number in the range is not included. Web’s following ack 84 says it expects byte 84 next. The stage’s acknowledgment field shows the full captured number instead. Tcpdump and the stage display the same numbering in different ways.
TCP uses these numbers and acknowledgments to notice missing bytes and send them again. No bytes are lost or sent again in this recording. Detailed sequence arithmetic, windows and retransmission belong to TCP Behavior and Packet Size.
Finish both sending directions
Section titled “Finish both sending directions”FIN says an end has finished sending bytes. Tcpdump writes F; [F.] also acknowledges the other direction. Each side must finish its sending direction and have that finish acknowledged.
Finish both sending directions
- laptop10.77.10.10
- web10.77.20.80
- Web finishes: web to laptop
- Laptop finishes: laptop to web
- Web acknowledges: web to laptop
In the capture3 messages at laptop:eth0
- 1. Web finishes
08:25:31.715161 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.45326: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0 - 2. Laptop finishes
08:25:31.715235 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.45326 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0 - 3. Web acknowledges
08:25:31.715281 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 85, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0
curl -sS http://10.77.20.80/hello.txt, on Ubuntu 24.04.5 LTS, netlab 1.0, tcpdump 4.99.4. The values are the capture's. The same connection closes in three captured messages because laptop combines its acknowledgment with its own finish.Machines by IP address; captured at laptop:eth0. Routers on the path are not drawn.Steps (3)
Machines by IP address; captured at laptop:eth0. Routers on the path are not drawn.
- Web finishes. web to laptop. Web has no more bytes to send. It also acknowledges the request.
08:25:31.715161 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.45326: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0 - Laptop finishes. laptop to web. Laptop acknowledges web’s finish and sends its own FIN in the same message.
08:25:31.715235 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.45326 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 306269759 ecr 4281951383], length 0 - Web acknowledges. web to laptop. Web acknowledges laptop’s finish. Both sending directions have closed.
08:25:31.715281 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.45326: Flags [.], ack 85, win 64, options [nop,nop,TS val 4281951383 ecr 306269759], length 0
| Message | Direction | Flags | Meaning |
|---|---|---|---|
| First opening | laptop → web | S |
Start |
| Second opening | web → laptop | S. |
Start and accept |
| Third opening | laptop → web | . |
Accept opening |
| Data | laptop → web | P. |
Request bytes |
| Web finish | web → laptop | F. |
No more bytes |
| Laptop finish | laptop → web | F. |
Accept and finish |
| Last reply | web → laptop | . |
Accept finish |
A normal close does not always need four rows. Here laptop uses one message to do two jobs. Read all the flags in each row before counting the steps.
Ask where nobody listens
Section titled “Ask where nobody listens”Predict: web has no listener on port 81. Does it stay silent or answer?
Repeat the experiment with listener filter tcp port 81 and curl -sS http://10.77.20.80:81/ in terminal 2.
learner@laptop:~$ sudo tcpdump -n -i eth0 tcp port 81[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes08:25:56.119850 IP 10.77.10.10.47718 > 10.77.20.80.81: Flags [S], seq 3200542471, win 64240, options [mss 1460,sackOK,TS val 3211202797 ecr 0,nop,wscale 10], length 0
08:25:56.119914 IP 10.77.20.80.81 > 10.77.10.10.47718: Flags [R.], seq 0, ack 3200542472, win 0, length 0^C2 packets captured
2 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (10)
- Type
sudo tcpdump -n -i eth0 tcp port 81 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - The second terminal finished. Return here and press Ctrl+C to stop listening.
- Output:
08:25:56.119850 IP 10.77.10.10.47718 > 10.77.20.80.81: Flags [S], seq 3200542471, win 64240, options [mss 1460,sackOK,TS val 3211202797 ecr 0,nop,wscale 10], length 0 08:25:56.119914 IP 10.77.20.80.81 > 10.77.10.10.47718: Flags [R.], seq 0, ack 3200542472, win 0, length 0 - Press Ctrl + C
- Output:
2 packets captured 2 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS http://10.77.20.80:81/curl: (7) Failed to connect to 10.77.20.80 port 81 after 0 ms: Couldn't connect to serverlearner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80:81/ - Press Enter
- Output:
curl: (7) Failed to connect to 10.77.20.80 port 81 after 0 ms: Couldn't connect to server
Check your answer
Web answers [R.]. RST, written R, resets or rejects a connection. Curl prints curl: (7) Failed to connect to 10.77.20.80 port 81 after 0 ms: Couldn't connect to server. The connection was refused, but web answered.
Mistakes to recognize
Section titled “Mistakes to recognize”“The handshake carries the page request.” The first data follows the three empty opening messages.
“Refused means the machine is down.” Web supplied the reset. The tested port did not accept this connection.
Good to know
Section titled “Good to know”Ports, timestamps and starting sequence numbers vary; your number will differ. Keep long option lists as recorded, even when only the flags matter to your question.
Try it yourself
Section titled “Try it yourself”Run the listener again and request index.html instead. Stop and compare: mark the opening, data and closing rows using their flags and lengths. Explain any message doing two jobs.
Solution
learner@laptop:~$ sudo tcpdump -n -i eth0 tcp port 80[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes08:26:21.454168 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [S], seq 1371011265, win 64240, options [mss 1460,sackOK,TS val 1715806243 ecr 0,nop,wscale 10], length 0
08:26:21.454224 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [S.], seq 699934166, ack 1371011266, win 65160, options [mss 1460,sackOK,TS val 1875603645 ecr 1715806243,nop,wscale 10], length 0
08:26:21.454232 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 1715806243 ecr 1875603645], length 0
08:26:21.454272 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 1715806243 ecr 1875603645], length 84: HTTP: GET /index.html HTTP/1.1
08:26:21.454279 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [.], ack 85, win 64, options [nop,nop,TS val 1875603645 ecr 1715806243], length 0
08:26:21.456736 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 1875603647 ecr 1715806243], length 172: HTTP: HTTP/1.0 200 OK
08:26:21.456765 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 1715806245 ecr 1875603647], length 0
08:26:21.459017 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 1875603650 ecr 1715806245], length 271: HTTP
08:26:21.459038 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 1715806248 ecr 1875603650], length 0
08:26:21.459076 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 1875603650 ecr 1715806248], length 0
08:26:21.459174 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 1715806248 ecr 1875603650], length 0
08:26:21.459246 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [.], ack 86, win 64, options [nop,nop,TS val 1875603650 ecr 1715806248], length 0^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (10)
- Type
sudo tcpdump -n -i eth0 tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - The second terminal finished. Return here and press Ctrl+C to stop listening.
- Output:
08:26:21.454168 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [S], seq 1371011265, win 64240, options [mss 1460,sackOK,TS val 1715806243 ecr 0,nop,wscale 10], length 0 08:26:21.454224 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [S.], seq 699934166, ack 1371011266, win 65160, options [mss 1460,sackOK,TS val 1875603645 ecr 1715806243,nop,wscale 10], length 0 08:26:21.454232 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 1715806243 ecr 1875603645], length 0 08:26:21.454272 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 1715806243 ecr 1875603645], length 84: HTTP: GET /index.html HTTP/1.1 08:26:21.454279 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [.], ack 85, win 64, options [nop,nop,TS val 1875603645 ecr 1715806243], length 0 08:26:21.456736 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 1875603647 ecr 1715806243], length 172: HTTP: HTTP/1.0 200 OK 08:26:21.456765 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 1715806245 ecr 1875603647], length 0 08:26:21.459017 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 1875603650 ecr 1715806245], length 271: HTTP 08:26:21.459038 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 1715806248 ecr 1875603650], length 0 08:26:21.459076 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 1875603650 ecr 1715806248], length 0 08:26:21.459174 IP 10.77.10.10.34440 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 1715806248 ecr 1875603650], length 0 08:26:21.459246 IP 10.77.20.80.80 > 10.77.10.10.34440: Flags [.], ack 86, win 64, options [nop,nop,TS val 1875603650 ecr 1715806248], length 0 - Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS http://10.77.20.80/index.html<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>web.lab.test</title>
</head>
<body>
<h1>web.lab.test</h1>
<p>This page comes from the lab machine web.</p>
<p><a href="hello.txt">hello.txt</a> · <a href="signin.html">Sign in</a></p>
</body>
</html>learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/index.html - Press Enter
- Output:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>web.lab.test</title> </head> <body> <h1>web.lab.test</h1> <p>This page comes from the lab machine web.</p> <p><a href="hello.txt">hello.txt</a> · <a href="signin.html">Sign in</a></p> </body> </html>
Mark SYN, SYN with ACK, and ACK as opening. A data length above zero marks a row that carries bytes. Follow each FIN to its acknowledgment for the close.
- Read opening flags before application data.
- Connect sequence ranges to acknowledgment numbers.
- Separate an orderly finish from a reset.
Next, UDP datagrams shows an exchange without this opening and close.