A, a, two machines are working, and the B machine is not listening on any ports. If a machine sends a SYN packet to the B machine 80 port, what type of return packet will be received?

Source: Internet
Author: User
Tags reserved socket
D, Port 1 not open

The server program port is not open and the client is connected. This situation is one of the most common and well understood. This error may occur when you go to Telnet to a port that is not open for TCP. This is related to the implementation of the operating system. In some cases, the operating system also ignores these send to open port requests completely. For example, in the following case, host 241 sends a SYN request to host 114, indicating that it wants to connect to the 40000 port of host 114, but the 114 port is not opened at all on host 40000, so a RST is sent to host 241. This is a common situation. In particular, the case of a sequential rst before restarting after a server program core dump is recurring.

Of course, on some operating system hosts, this may not be the performance. For example, a WINDOWS7 host sends a request to a port that does not exist, and the host does not respond.

2 Request timed out

Once encountered a situation where a client connects to a server, connect returns 1 and error=einprogress. Direct Telnet found no problem with the network connection. Ping does not appear to drop packets. Using the grab Bag tool, the client is inexplicably sending the RST after receiving the SYN from the server. For example, like this:

There are 89, 272 host computers. Host 89 sends a SYN to host 27, indicating that you want to connect 8888 ports, host 27 back to host 891 SYN indicates that you can connect. But host 27 is very unfriendly, inexplicably sent a RST that I do not want to connect you.

Later after the investigation found that the program on host 89 after the socket was established, with the setsockopt so_rcvtimeo option set the Recv timeout time is 100ms. And we look at the above grab packet results indicate that from host 89 Syn to receive SYN time up to 110ms. (from 15:01:27.799961 to 15:01:27.961886, the units after the decimal point are microseconds). Therefore, the program on host 89 considers the receive timeout, so the RST is sent to refuse to send the data further.

3 early closure about TCP, I think we read a word in the textbook, ' TCP is a reliable connection '. And that's a good thing to say, that is, every byte that the operating system receives from a TCP connection, I'll let the application receive it. What to do if the application does not receive. You guessed it, RST.

4 Receive data on a closed socket

If a socket is closed, but still receives the data will also produce the RST.


When the internetwork was originally designed for ease of addressing and hierarchical construction of the network, the IP addresses were layered, with each IP address having two identification codes (IDS), the network ID and the host ID. All hosts on the same physical network use the same network ID, and one host on the network (including workstations on the network, servers, routers, etc.) has a host ID corresponding to it.  The IP address is divided into 5 types according to the network ID, Class A address, Class B address, Class C address, Class D address, and Class E address. 1. Class A IP address
A Class A IP address consists of a 1-byte network address and a 3-byte host address, the highest bit of the network address must be "0", and the address range is from 1.0.0.0 to 126.0.0.0. There are 126 available Class A networks, each of which can hold more than 100 million hosts.
2. Class B IP Address
A class B IP address consists of a 2-byte network address and a 2-byte host address, the highest bit of the network address must be "10", and the address range is from 128.0.0.0 to 191.255.255.255. There are 16,382 available Class B networks, each of which can hold more than 60,000 hosts.
3. Class C IP Address
A Class C IP address consists of a 3-byte network address and a 1-byte host address, and the highest bit of the network address must be "110". range from 192.0.0.0 to 223.255.255.255. Class C network can reach more than 2.09 million, each network can accommodate 254 hosts.
4. Class D addresses are used for multipoint broadcasts (multicast).
Class D IP Address the first byte begins with "Lll0", which is a specially reserved address. It does not point to a particular network, which is currently used in multipoint broadcasts (multicast). Multicast addresses are used to address a group of computers at a time, identifying a group of computers that share the same protocol.
5. Class E IP Address
Start with "llll0" and use reservations for the future. Of the 3 main types of IP addresses, 3 zones are reserved as private addresses, with the following ranges of addresses:
Class A address: 10.0.0.0~10.255.255.255
Class B Address: 172.16.0.0~172.31.255.255
Class C Address: 192.168.0.0~192.168.255.255
The additional IPv6 address length is 128 bits, which is the next generation IP protocol designed by the IETF (Internet Engineering Task Force, Internet Engineering) to replace the current version of the IP Protocol (IPV4).

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.