"Tcp-ip Learning Summary" Transport layer protocol UDP and TCP

Source: Internet
Author: User

About ports

Communication between any two hosts on the internet is from one end to the other, also known as end-to-end communication.

What is a port?

Modern operating systems are equipped with many applications, information to my computer how do I know this message is passed to my QQ application? My QQ program is responding but my MSN did not respond to it?
The reason: My system has a number of port numbers, each application process is bound to a unique local port number, so that each program is bound to a port number. For example, QQ bound the local 6666 port number (assuming all UDP port number), this message sent, message header display to send to 6666 this port number, the above process is QQ program, because MSN bound is 8888 port number, so the message comes when QQ There is a reaction and MSN does not respond.

The port number is a 16-bit binary number. Therefore, the TCP protocol has 2 of 16, and UDP has 2 16 times a different port number.

The port number between 1~255 is managed by the Internet-HO distribution Agency
256~1023 port numbers are typically used by UNIX systems
Most TCP-IP protocols temporarily allocate port numbers between 1024~5000
Port number greater than 5000 reserved port number for other services

About the TCP protocol

TCP is the most commonly used protocol for Transport layer, and it is also a more complex protocol.
TCP establishes a link before the data is transferred and closes the link when the transmission ends

TCP three-time handshake for establishing a link

First handshake: The client issues a command to connect to the server
Second handshake: The server sends a message to the server whether it wants to connect
Third Handshake: Client confirmation link

Four-time handshake for TCP shutdown connection

First handshake: The client sends the Terminate connection command to the TCP protocol layer, and then the TCP protocol layer sends the message segment to the server to close the link
Second handshake: The server sends a confirmation message to the client after it receives the closing segment (the server can also continue to send messages, known as the semi-closed state)
Third handshake: If no message is sent on the server side, tell the server-side TCP protocol layer to send the close link message
Fourth handshake: After the client receives a message segment that closes the connection, it sends a confirmation that the link is completely closed.

About the UDP protocol

Characteristics:
① User Datagram Protocol UDP protocol is a non-connected, unreliable communication protocol that does not maintain end-to-end links with remote UDP modules.
②UDP The reliable measure in the process of data transmission is error checking, if an error occurs, just discard the datagram
③ How to target the data newspapers the number can not be matched then discard this datagram
④ high efficiency, low latency

"Tcp-ip Learning Summary" Transport layer protocol UDP and TCP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.