TCP/IP
TCP includes mechanisms to solve many of the problems that arise from packet-based messaging, such as lost packets, out of order packets, duplicate packets, and corrupted packets.
Since TCP is the protocol used most commonly on top of IP, the Internet protocol stack is sometimes referred to as TCP/IP
- TCP/IP addresses: Either a 32-bit IPv4 address in dotted decimal notation, or a 128-bit IPv6 address in colon hexadecimal notation.
- What you can do with TCP/IP:
- telnet: logging on to other hosts
- FTP
TCP 与 IP 的合作关系
IP is responsible for network(IP) addresses // 设置在 IP Header 里
TCP is responsible for reliable transmission of packets.
前面的 Header 一般称为 metadata,与后面的 data 作区分
TCP 与 UDP 的快捷描述
TCP includes error checking mechanisms which can handle when packets are lost, out of order, or corrupted.
UDP is a lightweight data transport protocol which does not do any error checking besides using a checksum to detect corrupted data.
While IP is just a routing protocol.
一些我的疑问
我的顿悟 所有的应用层协议不是基于TCP就是基于UDP的…大部分都是TCP TCP 可以 last 多久? 没有 limit, 但是如果太久没有数据交换,可能会被 NAT router 或者 firewalls expire 掉。
Established 与 LISTEN? Any "ESTABLISHED" socket means that there is a connection currently made there.
Any "LISTEN" means that the socket is waiting for a connection.
Both are opened ports but one is waiting for a connection to be made while the other has a connection already made.