Realize routing tracking with multiple protocols

zhaozj2021-02-16  73

Agreement Learning Summary II - Using Various Agreements to Realize Route Track TraceRoute

Using a variety of trace routing protocol: haha567

[Development and Operation Environment] Development Environment: Visual C 7.1 (Visual Studio.Net 2003), Windows XP Operation Environment: It is recommended to run [Download address and contact information on Windows 2000 and above) Documentation address: http: // Haha567.com/files/traceroute/traceroutedoc.htm Code Address: http://haha567.com/files/trahaha567.com/files/traraha567.com/files/trahaha567.com/files/traceroute/traceroutesrc.rar website: blog.haha567.com QQ: 4494634 E-mail: limin4@21cn.com Due to code It is written under VC 7.1, so you can't open it with VC 6. Users who use VC 6 can be converted with tools (VC 7 To VC 6 Project Converter), the tool introduction and download page is http: // Www.codetools.com/tools/prjconverter.asp. In addition, please use the latest version of SDK as possible when compiling using VC 6, so as not to find individual files. [Run screenshot]

[Reference book] 1, "Internet Internet Interconnection with TCP / IP protocol - Volume IP: Principle, Agreement and Structure", Fourth Edition, [United States] Douglas E. Comer, Electronic Industry Press 2, "TCP / IP Details - Volume 1: Agreement, [US] W. Richard Stevens, Machinery Press 3, "Windows Network Programming", Second Edition, [United States] Anthony Jones, Jim Ohlund, Tsinghua University Press 4 The reason why "Windows Core Programming" is placed in the forefront of the article, because it will mention a lot of knowledge in the text, limited to space, some of which can only be brought, in order to facilitate friends who are not familiar with these knowledge , List the title here. [Thanks] Thanks 9CBS Community and Safety Focus Forum for help, especially thanked users "annoying" and 9CBS community VC network version of the main "piggyXP" help. [Text] 1. Introduction to the ICMP Protocol and TraceRoute's implementation principle All Internet services use a bottom-free group delivery system, where a computer called an IP router or IP gateway provides all mutuals between physical networks. Even, it is used to select the path used to send the packet. When a router receives a packet, the source address and destination address in the group are analyzed. With the routing table inside the router, select one of the most appropriate paths to deliver the packet to the next host or router in the path. Then, when we send a data from a host to another host, sometimes to understand the network structure or analysis of the fault, you need to understand the network path passed by the datagram. The way to use is routing tracking, such a process is also It is called Traceroute. Before introducing Traceroute's implementation method, first introduce the ICMP protocol to implement Traceroute must rely on this protocol. In addition, it will also refer to the UDP and TCP protocols, but not intended to be described in detail here, specific knowledge can be seen, 1 and 2. In order for the router in the Internet to report errors or provide information about accidental situations, designers have joined a special-purpose packet mechanism in TCP / IP, which is called Internet Control Packet Protocol ICMP (Internet Control message protocol. In the normal IP datagram transfer, when the router finds an error or cannot forward a certain data, ICMP packets will be sent to the original site of the IP datagram, and the errors existing in the IP datagram are described. It should be noted that ICMP packets and other protocol packets (such as UDP packets, TCP packets) are also encapsulated in IP datagrams, as shown below, ICMP packets are divided into ICMP headers and ICMP data. Part, is packaged together in the IP datagram, IP datagram is also packaged in physical frames. In ICMP packets, there are 2 fields of type and code, and the causes of the problem are classified into a variety of causes through their values. The following is listed in several common ICMP packet formats, as well as several formats that Traceroute will encounter. 1. The return request and response newsletter usually use this packet format to determine whether the other host is up to date. The host or router sends an ICMP return request message to the specified destination station, any computer that receives this message forms a return response message, returns it to the initial sender. The ping command is actually sent to send this return request message, and then wait for the reception to answer the answer packet. When the type value is 8, the return request packet is represented, and when the type value is 0, the return response message is represented.

In the sender, the general convention is generally identified which process is identified (generally in the process ID as the identifier), and the message is identified by the serial number belonging to the process sent by the process. 2, the destination station is unreachable, when the router cannot forward or deliver the IP datagram, the destination station of the above format will not reach the message. According to the code value can be divided into 13 cases, it is necessary to specifically mention that when the code is 3, the meaning of the representation is "the port is not arrogant", but in fact, the data report has arrived at the target host, but the target port is not responding. Therefore, the target host generates "port irreparably" packets, only from naming, must pay attention to it. When sending UDP packets to an unable to respond to a target host, the target host will generate such packets, where the code value is 3.3, and the datagram classification format When the router's selection route occurs, A selection cycle may be formed, in order to avoid entering the loop's datagram, each datagon contains a lifetime timer, which is the TTL field in the IP datagram. As long as the router processes a data report, the TTL value is reduced, and the datagram is dropped when the value is reduced by 0, and the data report is done, where the type value is 11, the code value is 11, the code value 0. Let's take an example to describe the implementation principle of TraceRoute. Assume that the source host sends an IP datagram to the target host, when the data is reported to the target host, a total of 10 routers forwarded, obviously the TTL value in the IP datagram in the source host should be greater than 10, otherwise the data The report is timeout, and cannot reach the target host. If the source host sends a TTL value of N (1 ≤ 10) to the target host, the datagram is unable to reach the target host, and the nth router is timeout during the way, the router will go to the source host Send an ICMP timeproof, the source host can obtain the IP address of the Nth router on the way according to the timepiece. If the source host sends a TTL value of M (M ≥ 11) to the target host, the datagram can reach the target host. If you encapsulate different types of protocol packets in this IP datagram, the target host will make different reactions, below our classification. 1. If the IP datagram package is packaged is an ICMP return request message, the target host sends an ICMP return response message to the source host. 2, if the IP datagnet package is UDP packet, the target port will be specified in this message. If the target port on the target host is not bound to a UDP socket, the target host is not binded to a UDP socket. Just send an ICMP port to the source host, if the target port on the target host has been bound to a UDP socket, the UDP message is sent to the related socket. The system will not generate the ICMP ports that are unreachable, so when using this protocol, you must pay attention to the choice of the target port. 3. If the IP datagon is packaged in the TCP message, the message also specifies the target port and sets it in the SYN flag 1 as the first handshake.

If the target port on the target host is in the listening state, then the target host responds to a TCP packet to the source host, where the SYN and ACK flag position 1, the confirmation number is the serial number of the last handshake, but if At this time, the target port on the target host is not in the listening state, then the target host will respond to the source host, but the RST and ACK flag position 1, indicate reset, but the confirmation number is the next sequence of handshake. Add the number of bytes received, plus 1, here the number of bytes refers to the number of data parties in the TCP packet, in order to verify this, the program is the first time the TCP report The text adds 10 bytes of data parts. Then, in order to obtain the source host to the router address along the target host, the source host only needs to send the TTL value of 1, the TTL value is 2, the TTL value is 3 ..., the IP datagram, which receives the ICMP timeout returned along the router. The message is extracted from the router address until the response from the target host is finally received. In addition, when the router cannot deliver the datagram to the target host, the router will generate an ICMP destination station that the ICMP destination will be sent to the source host. At this point, the TraceRoute process should also be terminated. After a comparison, the first way to carry out routing is the simplest, but why should I achieve two other ways? Oh, please refer to you. Second, using the original Socket implementation and its point in order to facilitate the convenient configuration of the various messages mentioned above, the original Socket can be used to populate all the fields of the IP datagram and the internal package. In addition, after the original Socket is set, the system will receive all ICMP packets, the UDP packets, and TCP packets are copied to this original Socket, so the same socket can be used to listen to the above three types of protocols received by the system. Packets, but we only pay attention to the two types of ICMP and TCP, identify them one by one, and filter out the packets returned by the target host from it. Here is not intended to be meticulous explanations for the original Socket, and specific knowledge can be seen from the book 3. However, there is still a need to mention 3 special settings for the original Socket in this procedure. IP_HDRINCL: The IP header can be constructed by setting this option. This is necessary for generating and transmitting UDP and TCP protocol packets, but for generating and transmitting ICMP packets, it is not necessary. For unified processing, this option is set, regardless of the IP datagram The packet is required to manually construct an IP header. Ipproto_ip: Due to the original Socket in the program, ICMP, UDP, TCP can involve sending and receiving of ICMP, UDP, TCP, and they are packaged in IP datagrams, so setting the type of the original Socket protocol to ipproto_ip, This will take into account these three protocol packets. SIO_RCVALL: By setting this option, the original socket can be made to receive all the data received on the local network interface that is bound to. If the option is not set, the system does not register this TCP connection because it is sent by the original socket, the system does not register this TCP connection, so the system receives the TCP of the setting ACK flag returned by the target host. When packets, the packets will be discarded directly, and this original Socket will not be forwarded, so this option must be set to receive the response of the target host. Third, the interface description and port selection is as shown in the figure, there are many control elements on the interface, and the use is explained one by one.

Target Address: As the name suggests, the address of the target host can be filled in its IP address, and the program can be filled in its domain name, and the program will automatically parse its IP address. If it is unable to resolve, the error prompt will be reported. Type of protocol: Provide ICMP, UDP, TCP type supplies, respectively, corresponding to the three TraceRoute mentioned above. Target Port: This option is invalid for the ICMP protocol for the UDP protocol and TCP protocol. Source port: This option is invalid for the ICMP protocol for the UDP protocol and TCP protocol. Timeout: When waiting for the target host or the router, there is no need to wait, so it provides timeout settings. Continuous timeout maximum value: If there is no response from the target host or the router within the timeout, it is not reasonable to terminate TraceRoute because it may be due to timeout time setting too short, or a router is prohibited by a router on the way. Timeout IP datagram. A relatively stable approach increases the TTL value, continue to detect the next router, of course, we should not always ignore, so provide an option to set a maximum number of continuous times, when this maximum is reached, before you get "waiting timeout" Conclusion, stop Traceroute so that users can consider whether to extend timeout, or derived the "target host unreachable" conclusions. Number: Indicates that the router or the target host is the first few nodes on the path. Address: The IP address of the router or the target host is displayed. Status: It is used to represent what state is current (to the router, reaching the target host or cannot reach the target host). Receive package number: Used to indicate the number of the package in all received packets. Port Selection Notes: When you select an ICMP protocol, you don't have to pay attention to the port. When selecting a UDP protocol, the target port may need to try multiple different ports to select a UDP port that is not bound on the target host system, otherwise the required response cannot be received. When the TCP protocol is selected, the target port suggests that the 80 port is selected, because if the target host is a web server, it will open the service at this port, even if it is not, it will receive the RST ACK response. In addition, the firewall rules on the target host will directly affect the choice of ports and source ports. When determining that the target host exists, if it is still timeout, it is generally due to the configuration of the firewall on the target host. Please try another port or protocol For example, for a partial site When passing through the TCP mode, the source port cannot be 0, and when the Tag port is passed, the target port cannot be 80. In general, if the other host does exist, then for ICMP mode, as long as the gateway does not limit, the chance of success reaching the target is the largest, for TCP mode, when the target port is 80, when the source port is not 0, it can be successfully connected To most Web sites, the UDP mode needs to try multiple port numbers. Fourth, the program control points 1, in the program, create a secondary thread for TraceRoute, because the entire program only has a thread, then network operations affect the window message loop, resulting in "dead" of the window. 2, using the WSAEventSelect model, but due to the need for program control, the following three events will be waited from WSAWAITFormultiPleevents, and the knowledge about the model can be seen to see Book 3. WSAEVENT_TRACE: This event is used to associate fd_read.

WSAEVENT_WAIT_STOP: When it is required to terminate TraceRoute from the program interface, it is not possible to let the auxiliary thread will know the event and make a notice of the event. WSAEVENT_TIMER: After each send a message, wait for the Router or the target host to respond, this waiting has a timeout, according to the general idea, you can use the timeout time as the timeout parameters of the WSAWAITFormultEvents function, but it is still ignored a problem. Because we use the original socket to receive data, we will receive a lot of data that is not sent to this socket, because for the system, the data sent by the original Socket is not recorded, so it will copy the received ICMP packet Send to the original socket, when the TCP protocol is selected, because SiO_RCVALL is set, the received independent data is more. Every time you receive a unrelated datagon, you will trigger WSAEvent_Trace, so when the network is busy, WSAWAITFormultiPleEvents is almost impossible to timeout, and it is not possible to perform valid timeout detection. In order to solve this problem, a timeout control mode-independent timeout control method-timer is selected in the program, and the timer can also be managed by WSAWAITFORMULTIPEEVENTS. When sending a message each time, reset the timer, so no matter how many packets received, it will not affect timeout detection. 5. The code process is used to perform the TraceRoute process. All of them are located in the file tracethread.cpp, where the process is more complicated, so use the text to simply describe the code of the main function is as follows.

DWORD WINAPI TRACTHREAD (PVOID PVPARAM) {According to the selected protocol type, calculate the length of the IP datagram to be sent, assign appropriate space as a packet transmission buffer; fill the IP header in the packet transmission buffer, and set the TTL value 0, fill the protocol message of the package; create the original socket, the protocol type is ipproto_ip, configure the socket to construct the IP header (IP_HDRINCL), bind the socket to the local network interface; if you choose to use the TCP protocol, configure The socket receives all the data received on the network interface of the network; initializes the three events mentioned above, and associates WSAEvent_trace with fd_read through the WSAEventselect function; set the TRACEEND = FALSE, the flag is used to judge when to end in the later cycle; the DO {adds the TTL value in the IP header to send the IP datagram; reset the timer, the timer is used to check the timeout; The effective sign is false, BRECVDATAISVALID = FALSE; Do {WSAWAITFORMULTIPLEEVENTS, waiting for one of the three events mentioned above; if (Function WSAWAITFORMULTIPEEvents call failed) tagged as an error exit, turn EXIT0; if (Event WSAEvent_timer According to the number of continuous times, select the timeout exit, or the inner layer of the BREAK is cycled to enter the next round of outer cycles, continue to detect the next router; if (event WSAEvent_Wait_Stop is transmitted) tagged as manual termination, transfer EXIT0; // There is already data that can receive received data; if the IF (received data is not transmitted to the unit) Continue, continue to wait for the next datagram; assign a function analysis, which is partalySetcppPacket or analyzEICMPPACKET, respectively, according to the type of received message. Analysis; (the above analysis function identifies whether the message is effective, that is, whether "arrival router", "arrive at the target host", "unable to reach the target host" three status) IF (packet invalid) Continue, continue waiting The next datagram; // The message is analyzed by the effective mark, BRECVDataSvalid = TRUE, the number of times the continuous timeout is cleared; if (message represents the target host), the TRACEEND is true, BTRACEEND = True; if (message representation is not up to the target) Set the TRACEEND = FALSE;

Notification window interface Displays the host IP address of the message, as well as the current state (to the router, reaching the target host or cannot reach the target host);} while (BRECVDataSvaliD == false); // If the data is invalid, you will enter the next Wheel loop, continue to wait for the next datagram} while (btracend == false); // If the TRACEEND flag is invalid, then enter the next round of loop, continue to detect the next router EXIT0: Make the final end, get the error code, Turn off event objects, release the send buffer memory, turn off the socket;} The two functions involved in the thread function (AnalynsetCPCKET and Analych "implementation code is as follows: //// AnalySetcppacket //// @ ipv4hdr Data Send IP header address in the buffer @ RECBV_IPV4HDR data receiving the IP header address in the buffer @ @RTRACEPROTOCOLTYPE selected protocol type /// @return /// nretResult 0 indicates failure, not datagrams required analysis is successful //// nRetResult 1 //// int AnalyseTCPPacket (IPV4_HDR * ipv4hdr, IPV4_HDR * recv_ipv4hdr, int nTraceProtocolType, int & nRetMessageID) {int nRetResult = 0; int nIPv4_HDRSize = 0; TCP_HDR * tcphdr = NULL ; TCP_HDR * recv_tcphdr = NULL; nRetResult = 0; nRetMessageID = MESSAGE_OTHER_PACKET; // other packets nIPv4_HDRSize = (ipv4hdr-> ip_verlen% 0x10) * 4; tcphdr = (TCP_HDR *) ((unsigned char *) ipv4hdr nIPv4_HDRSize); nIPv4_HDRSize = (recv_ipv4hdr-> ip_verlen% 0x10) * 4; recv_tcphdr = (TCP_HDR *) ((unsigned char *) recv_ipv4hdr nIPv4_HDRSize); if (! ipv4hdr-> ip_destaddr = recv_ipv4hdr-> ip_srcaddr) goto Exit0; if (tcphdr- > TCP_DESTPORT! = Recv_tcphdr-> TCP_SRCPORT) GOTO EXIT0;

// When the target port is not listening, the other party returns ACK RST, the number is the number of sequence numbers received for the first time, the number of bytes received 1 if (Recv_tcphdr-> tcp_flags == 0x14 && Ntohl (RECV_TCPHDR-> TCP_ACKNOWEDGEMENT) == NTOHL (TCPHDR-> TCP_SEQUENCE) 10 1) {nretResult = 1; NretMessageId = message_reach_dest;} // When the target port is listening, the other party returns ACK SYN, the confirmation number is the first time. serial number plus 1 if (recv_tcphdr-> tcp_flags == 0x12 && ntohl (recv_tcphdr-> tcp_acknowledgement) == ntohl (tcphdr-> tcp_sequence) 1) {nRetResult = 1; nRetMessageID = MESSAGE_REACH_DEST;} // some of these two codes Redundancy, but I hope to describe the conditional description clear EXIT0: RETURN NRETRESULT;} //////////////////// / @ RECBV_IPV4HDR data receiving the IP head in the buffer Address /// @ntraceprotocoltype selected protocol type @ @return //// nretResult 0 Indicates the analysis failed, not required data / /// nretresul t 1 analysis is successful, reaching the target and arriving at the router, or an error //// int AnalyseICMPPacket (IPV4_HDR * ipv4hdr, IPV4_HDR * recv_ipv4hdr, int nTraceProtocolType, int & nRetMessageID) {ICMPV4_HDR * icmpv4hdr = NULL; ICMPV4_HDR * recv_icmpv4hdr = NULL; unsigned char * ptr1 = NULL; unsigned char * ptr2 = NULL; int nIPv4_HDRSize = 0; int nRetResult = 0; nRetResult = 0; // failure analysis is not required datagram nRetMessageID = MESSAGE_OTHER_PACKET; // other packets nIPv4_HDRSize = (ipv4hdr -> ip_verlen% 0x10) * 4; ICMPV4HDR =

(ICMPV4_HDR *) ((unsigned char *) ipv4hdr nIPv4_HDRSize); nIPv4_HDRSize = (recv_ipv4hdr-> ip_verlen% 0x10) * 4; recv_icmpv4hdr = (ICMPV4_HDR *) ((unsigned char *) recv_ipv4hdr nIPv4_HDRSize); switch (recv_icmpv4hdr-> icmp_type) {case 0: // echo reply message if (nTraceProtocolType == IPPROTO_ICMP && ipv4hdr-> ip_destaddr == recv_ipv4hdr-> ip_srcaddr && icmpv4hdr-> icmp_id == recv_icmpv4hdr-> icmp_id && icmpv4hdr-> icmp_sequence == recv_icmpv4hdr-> icmp_sequence) {nRetResult = 1; nRetMessageID = MESSAGE_REACH_DEST;} break; case 3: // destination unreachable packets case 11: // timeout packets ptr1 = (unsigned char *) ipv4hdr; ptr2 = (unsigned char *) recv_icmpv4hdr 8; // Point to generate an error-generating IP header // whether the head 8 bytes of the IP head and the inner datagon is unanimously * (PTR2 4) = 0; // Set IP_ID to zero, easy to compare * (Ptr2 5) = 0; * (PTR2 10) = 0; // Set ip_checksum to zero, easy to compare * (PTR2 11) = 0; if (MEMCM p (PTR1, PTR2, 8)! = 0) Break; IF (Memcmp (PTR1 9, PTR2 9, 17)! = 0) // Skip TTL fields, including UDP, but does not include school and test (not understand why not contain checksum) break; if (recv_icmpv4hdr-> icmp_type == 11 && recv_icmpv4hdr-> icmp_code == 0) {nRetResult = 1; nRetMessageID = MESSAGE_REACH_ROUTER; break;} if (recv_icmpv4hdr-> ICMP_TYPE == 3) {nretResult = 1; if (Recv_icmpv4HDR-> ICMP_CODE ==

3 && // Port Unreachable Message IPv4HDR-> IP_PROTOCOL == IPPROTO_UDP && // The UDP protocol will generate such packets RECV_IPV4HDR-> ip_srcaddr == sindest.sin_addr.s_addr // is returned by the target address) NRETMESSAGEID = Message_reach_dest; else nret_reach_dest; break;} Break;} Return NretResult;}, still there is still no solution to the current knowledge, there is only one problem that there is still no way: When the target address is the native IP address, via ICMP And UDP can successfully reach the target host, but cannot reach the target host through the TCP mode, waiting for timeout. The reason why the upper layer is realized that a packet is sent to the locally by this unit, and the data package will be transferred directly to the related module, and it is not sent via the NIC. The three protocols are through the original Socket to obtain relevant packets, and the listening level determines if it can receive a packet from this machine to this unit, when selecting ICMP and UDP mode, with the TCP mode, The original Socket listening setting is different. Guessing is the difference between the two settings determines the difference in the listening level, resulting in the first two ways to receive the packet from the unit to the native, and the latter way is not. However, when the target address is a local address, there is no need to pass any routes, so this problem does not affect the original design intention of the program. Seven, postscript from me to study the ICMP protocol to the current development of this small program, the intermittent, it is half a year. In the article, I will recall the whole way to the dragon, there are many ideas and think ... The earliest time, hands Only 2 books, "Internet Internet Internet Internet Internet" and "Windows Network Programming", "WINDOWS Network Programming", "For the former book, I have learned the ARP protocol, wrote a graphical interface ARP package The sending tool is precisely because of this stuff, I met PiggyXP and annoyance, thanking them for helping me for so long. Now I see the ARP sending tool written by PiggyXP. I didn't dare to take it out. Oh ... After I finished ARP, I started learning IP and ICMP, or the habit, I plan to do something, from "Windows Network Programming "I saw the example of using the original socket to implement Traceroute, I feel good, so I have made one with the ICMP protocol, and I really didn't think of other agreements, but very depressed is that the company can't run. Guess the recent gateway from his nearest gateway is not responding and forwarding ICMP, it is probably because the virus is a cause.

Later, I had to pass it to netizens to help test, huh, tested test results to give me through the screenshot! After you have annoyed (don't look wrong, this netizen is called "annoying", after I am too lazy to play double quotes), I talked about this depressed thing in the company, and he proposed that I tried it with the UDP protocol. So I sent me the relevant chapters on "TCP / IP Details". After reading, I suddenly turned over, so I went to the next day, the company was not going to work, and I rushed to the bookstore of Wan Tzi Sand to buy this book, at the seaside I found a stone bench and sat there on the sea breeze. I saw a afternoon (Oh, there is a friend who is Zhuhai, I should be very familiar with it), this book is more detailed than another, and there are many Examples of scenario analysis are ideal for further understanding of the agreement. After reading the book, I can realize this stuff with UDP and TCP, but I still have doubts in my heart. If the company gateway prohibits the two-way ICMP, then I've added IRIS. Simple experiment, I concluded that the company gateway only made the ICMP sent to it to its intranet. Well, I have to mention that IRIS is really a good thing, especially if I can make myself, then I will send it out, really It is very convenient, but if you can write Sniffer, you can write a Sniffer yourself like PiggyXP. Later, ICMP, UDP and TCP were started to implement Traceroute, since the reference material is complete, soon, using the original Socket to achieve the effect through UDP, but when testing a non-existing IP address, discovery If the timeout effect cannot be reached, debugging findings often have a UDP packet that is sent to the local address by this unit, and the timeout time is a timeout time parameter as a function WSAWAITFORMULTIPEEVENTS, so it is difficult to meet me as before The timeout imagined. Depressed for a whole week, suddenly there is a day to find that the program can be normal timeout when I close the SQL Server service manager, um ... It turns out that the SQL Server Service Manager will check the SQL on the machine every 5 seconds by default. Server server status, so I often receive a UDP packet from this machine to this machine. As above, the problem has appeared, how to solve it? During a week, when the model is very vague exploration solution, the fortunate colleague reminds the timer, so I caught the "Windows Core Programming", which, the night coding, successfully solved this problem, haha ​​... principle Not much to Luo Tao, the foreman should write clear. Soon, I met the next question is about TCP. At that time, I didn't know enough for TCP. I thought I sent a SYN, and the other party should be an ACK SYN, and the confirmation number should be equal to the serial number I sent 1, but found Connecting some ports that are not listening to the status is returned but the ACK RST, and the confirmation number and my budget are different. Later, due to the busy reasons, this problem was put down, so I went once, I plan to take "TCP / IP Detailed explanation", when I stayed in early June, I saw TCP here. The RST is the reason, um ... another difficult gate is broken, and the program has been generally completed, starting a lot of testing ... During the test process, if the target host does exist, when using the UDP and TCP, if the two protocols are used There is a great relationship to successfully reach the target host and the two port numbers.

The end number of the port number on the early interface is the target port 80, source port 0, no problem in the internal network, many sites of the external network are no problem, but there are exceptions, such as connecting www.microsoft.com with TCP, later used IRIS has passed a variety of attempts that the problem is that the source port number cannot be 0, and then changed to 2000, and successfully reached the target host. As for the port number, the point of choice is already summarized, and it is not more than Luo. A problem has also been discovered during the test. When the TCP mode is selected, the target address fills in the unit address and eventually cannot reach the target host. The specific situation of this problem has been described in section 6 of this article. Later, it is later, how to receive the TCP packet from this machine to this machine through the original Socket, so far, there is no finding solution ... I hope that you can see this article. Help me to solve this problem. Luo Luo wrote so much, I hope you have already understood it. If you still don't understand or don't agree, please contact me through the contact details of the article and discuss together. Published on June 25, 2004 9:10 PM

HREF = "/ limited" Rel = "pingback">

转载请注明原文地址:https://www.9cbs.com/read-18311.html

New Post(0)