Article Directory
Outline
English: Transmission Control Protocol, abbreviated as TCP
TCP is a transport control protocol ; is a connection-oriented , reliable , based on the byte stream transport layer communication protocol defined by the IETF RFC793
Establish and Release connection: three-way handshake, waving four
TCP has a checking mechanism, reliable, stable data transmission
TCP connection, transmission flow
TCP can do
chat messaging, push
single voice, video chat
almost UDP can do can do, but need to consider the complexity, performance issues
Restriction: can not be broadcast, multicast, and other operations
TCP kernel API
socket (): create a Socket
Socket just created can be stateless in subsequent binding operation information in response
bind (): bind a Socket to a local address and port
connect (): connection to a remote socket
accept): to accept a new connection
This is unique to the server
write (): write data into the output stream Socket
read (): read data from the input stream Socket
Process
Client:
: server-side
relationship with the process of Socket
TCP connection reliability
Three-way handshake:
three-way handshake is necessary random
four wave:
ACK are loopback command
U is a random value V is a random value
TCP transmission reliability
Sliding window protocol
Reference details Computer Network] Xie Xiren note transport layer