| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Description | |
| 16-bit Source Port (출발지 포트 번호) | 16-bit Destination Port (목적지 포트 번호) | ↑↓20 bytes | ↑↓20~60 bytes | ||||||||||||||||||||||||||||||
| 32bit Sequence Number (순번) | |||||||||||||||||||||||||||||||||
| 32bit Acknowledgment Number (예측 순번, ACK flag 가 설정된 경우) | |||||||||||||||||||||||||||||||||
| 4-bit Data Offset (TCP Header length) | 3-bit Reserved (0 0 0) | 1-bit NS | 1-bit CWR | 1-bit ECE | 1-bit URG | 1-bit ACK | 1-bit PSH | 1-bit RST | 1-bit SYN | 1-bit FIN | 16-bit Window Size | ||||||||||||||||||||||
| 16-bit Checksum | 16-bit Urgent Pointer | ||||||||||||||||||||||||||||||||
| Variable-size Options (Data Offset 값이 5보다 큰 경우, Options의 마지막이 32bits로 정렬되기 위해서 padding을 포함할 수 있음.) | Padding | ↑↓0~40 bytes | |||||||||||||||||||||||||||||||
| Variable-size Data | ↑↓ Total length - Header length(Data Offset) | ||||||||||||||||||||||||||||||||
RFC3540 - Robust Explicit Congestion Notification (ECN) Signaling with Nonces
(https://tools.ietf.org/html/rfc3540))
RFC3168 - The Addition of Explicit Congestion Notification (ECN) to IP
(https://tools.ietf.org/html/rfc3168))
RFC3168 - The Addition of Explicit Congestion Notification (ECN) to IP
(https://tools.ietf.org/html/rfc3168))
RFC793 Section-3.1
(https://tools.ietf.org/html/rfc793#section-3.1))
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Description | |
| 32-bit Source Address | ↑↓8 bytes | ↑↓12 bytes | |||||||||||||||||||||||||||||||
| 32-bit Destination Address | |||||||||||||||||||||||||||||||||
| 8-bit Zero | 8-bit PTCL(Protocol) | 16-bit TCP Length (TCP Header + Data) | ↑↓4 bytes | ||||||||||||||||||||||||||||||
RFC2460 Section-8.1
(https://tools.ietf.org/html/rfc2460#section-8.1))
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Description | |
| 128-bit Source Address | ↑↓32 bytes | ↑↓40 bytes | |||||||||||||||||||||||||||||||
| 128-bit Destination Address (Final destination address) | |||||||||||||||||||||||||||||||||
| 32-bit Upper-Layer Packet Length | ↑↓4 bytes | ||||||||||||||||||||||||||||||||
| 24-bit Zero | 8-bit Next Header | ↑↓4 bytes | |||||||||||||||||||||||||||||||
https://www.freesoft.org/CIE/Course/Section4/8.htm
)
| 참고 이미지 |
![]() [PNG image (69.29 KB)] |
이미지 출처: https://en.wikipedia.org/wiki/File:Tcp_state_diagram_fixed_new.svg |
RFC793 - TRANSMISSION CONTROL PROTOCOL DARPA INTERNET PROGRAM PROTOCOL SPECIFICATION
(https://tools.ietf.org/html/rfc793)
https://tools.ietf.org/html/std7
RFC791 - TRANSMISSION CONTROL PROTOCOL DARPA INTERNET PROGRAM PROTOCOL SPECIFICATION
(https://tools.ietf.org/html/rfc791)
RFC1071 - Computing the Internet Checksum
(https://tools.ietf.org/html/rfc1071)
RFC1122 - Requirements for Internet Hosts -- Communication Layers
(https://tools.ietf.org/html/rfc1122)
RFC1323 - TCP Extensions for High Performance
(https://tools.ietf.org/html/rfc1323)
RFC1379 - Extending TCP for Transactions -- Concepts
(https://tools.ietf.org/html/rfc1379)
RFC1948 - Defending Against Sequence Number Attacks
(https://tools.ietf.org/html/rfc1948)
RFC2018 - TCP Selective Acknowledgment Options
(https://tools.ietf.org/html/rfc2018)
RFC2460 - Internet Protocol, Version 6 (IPv6) Specification
(https://tools.ietf.org/html/rfc2460)
RFC3168 - The Addition of Explicit Congestion Notification (ECN) to IP
(https://tools.ietf.org/html/rfc3168)
RFC3540 - Robust Explicit Congestion Notification (ECN) Signaling with Nonces
(https://tools.ietf.org/html/rfc3540)
RFC5681 - TCP Congestion Control
(https://tools.ietf.org/html/rfc5681)
RFC6247 - Moving the Undeployed TCP Extensions RFC 1072, RFC 1106, RFC 1110, RFC 1145, RFC 1146, RFC 1379, RFC 1644, and RFC 1693 to Historic Status
(https://tools.ietf.org/html/rfc6247)
RFC6298 - Computing TCP's Retransmission Timer
(https://tools.ietf.org/html/rfc6298)
RFC6824 - TCP Extensions for Multipath Operation with Multiple Addresses
(https://tools.ietf.org/html/rfc6824)
RFC7323 - TCP Extensions for High Performance
(https://tools.ietf.org/html/rfc7323)
RFC7414 - A Roadmap for Transmission Control Protocol (TCP) Specification Documents
(https://tools.ietf.org/html/rfc7414)
https://en.wikipedia.org/wiki/Transmission_Control_Protocol
https://en.wikipedia.org/wiki/Protocol_data_unit
https://hpbn.co/building-blocks-of-tcp/
Service Name and Transport Protocol Port Number Registry
(https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
https://live.paloaltonetworks.com/t5/Learning-Articles/TCP-MSS-adjustment-for-IPSec-traffic/ta-p/74988
http://www.freesoft.org/CIE/Course/Section4/8.htm
https://www.joinc.co.kr/w/Site/TCP_IP/TCP_Header
https://kldp.org/node/30779
https://live.paloaltonetworks.com/t5/Learning-Articles/TCP-MSS-adjustment-for-IPSec-traffic/ta-p/74988
https://cs.senecac.on.ca/~raymond.chan/topics/tcp/checksum.html
https://sostarzia.tistory.com/44?category=222287
http://www.ktword.co.kr/test/view/view.php?m_temp1=1889
https://rhyshan.com/278
https://mr-zero.tistory.com/36
https://brunch.co.kr/@lars/1
https://m.blog.naver.com/s2kiess/30165976105
(TCP Response)
https://12bme.tistory.com/538
https://meetup.toast.com/posts/55
https://serverfault.com/questions/866234/rst-ack-after-syn-and-retransmission
https://tech.kakao.com/2016/04/21/closewait-timewait/
https://m.blog.naver.com/newyks/220268492408
("TCP 세그먼트의 Sequence number?")
리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 - 3편
(https://meetup.toast.com/posts/55)
https://m.blog.naver.com/goduck2/221117234954