CN102625332A - Method for detecting network routing - Google Patents

Method for detecting network routing Download PDF

Info

Publication number
CN102625332A
CN102625332A CN201110338471XA CN201110338471A CN102625332A CN 102625332 A CN102625332 A CN 102625332A CN 201110338471X A CN201110338471X A CN 201110338471XA CN 201110338471 A CN201110338471 A CN 201110338471A CN 102625332 A CN102625332 A CN 102625332A
Authority
CN
China
Prior art keywords
router
source terminal
address
ttl
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201110338471XA
Other languages
Chinese (zh)
Inventor
张伟良
屈恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Technology Co Ltd
Original Assignee
Beijing Xiaomi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Technology Co Ltd filed Critical Beijing Xiaomi Technology Co Ltd
Priority to CN201110338471XA priority Critical patent/CN102625332A/en
Publication of CN102625332A publication Critical patent/CN102625332A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for detecting network routing, which is applicable to the mobile internet. The method includes firstly, establishing an echo-reply type ICMP (internet control messages protocol) packet with TTL (time to live) of 1 by means of a SOCK_DGRAM parameter according to an address of a target terminal by a source terminal; secondly, sending the ICMP packet to the target terminal by the source terminal, and waiting for a timeout reply of TTL of a target machine or a midway router by the source terminal; thirdly, extracting and analyzing the IP (Internet Protocol) address therein by the source terminal after receiving the reply packet; if the packet is sent by the midway router, then recording the IP address of the router, adding 1 to the TTL and returning to the former step; and if the packet is sent by the target terminal or the timeout reply of the TTL reaches the upper limit of the default, completing the whole routing detection. According to the technical scheme, the basic function of traceroute can be implemented on mobile devices, and the collection of data of network connectivity problems in use is facilitated.

Description

The method that a kind of network route detects
Technical field
The present invention relates to mobile internet technical field, relate in particular to the method that a kind of network route detects.
Background technology
At present; In network route testing process; The Traceroute modes that adopt, Traceroute is an order in Unix and the (SuSE) Linux OS originally, can know that through this order information arrives the routing node of object-computer passage in transit from local computer more.
Traceroute sends Internet control message protocol (ICMP) back message using with different life spans (TTL) to object-computer, to be determined to the route of object-computer.Each router on the path all will subtract 1 with its TTL value at least before transmitting this icmp echo message, so TTL is effective jump on count.When the TTL of message value reduced to 0, router was beamed back the ICMP time-out information to source computer.Be first back message using of 1 and in transmission subsequently, the TTL value added 1 at every turn that up to target response or reach maximum TTL value, Traceroute can confirm route through sending TTL.Through ICMP overtime (Time Exceeded) information that the inspection intermediate router is beamed back, can confirm router.
But this mode is not suitable on mobile devices such as mobile phone, using because function is various, and its use SOCK_RAW parameter, needs administrator right to move, and on mobile device, can't realize.
Summary of the invention
The objective of the invention is to propose the method that a kind of network route detects, be applicable to mobile Internet, can on mobile device, realize basic Traceroute function, help to collect the data of the network connectivity issue that runs in the use.
For reaching this purpose, the present invention adopts following technical scheme:
The method that a kind of network route detects is applicable to mobile Internet, may further comprise the steps:
A, source terminal be according to the address of target terminal, uses the SOCK_DGRAM parameter to set up the ICMP bag that a life span is 1 echo acknowledgement type;
B, source terminal send said ICMP bag to target terminal, and source terminal is waited for overtime the replying of life span of router in target machine or the way;
After C, source terminal receive the response packet of router in target terminal or the way; Extract and analyze the IP address in the said response packet, if overtime the replying of life span that router sends in the way, the IP address of then writing down said router; And life span is added 1, return step B; Reply or the overtime upper limit that reaches preset of replying of life span if the life span that target terminal sends is overtime, then accomplish whole route and detect.
Adopted technical scheme of the present invention; Can use SOCK_DGRAM and IPPROTO_ICMP parameter to create socket; Avoided the problem of the necessary use and management person's authority of SOCK_RAW parameter; Thereby can on mobile device, realize basic Traceroute function, help to collect the data of the network connectivity issue that runs in the use.
Description of drawings
Fig. 1 is the flow chart that the network route detects in the specific embodiment of the invention.
Embodiment
Further specify technical scheme of the present invention below in conjunction with accompanying drawing and through embodiment.
Fig. 1 is the flow chart that the network route detects in the specific embodiment of the invention.As shown in Figure 1, this flow process that is applicable to that the network route of mobile Internet detects may further comprise the steps:
Step 101, source terminal be according to the address of target terminal, and using the SOCK_DGRAM parameter to set up a life span (TTL) is ICMP (ICMP) bag that 1 echo is replied (ECHO) type.
Step 102, source terminal send the ICMP bag to target terminal, and source terminal is waited for overtime the replying of TTL of router in target machine or the way.
After step 103, source terminal receive the response packet of router in target terminal or the way, extract and analyze the IP address in the response packet.
Step 104, judge that whether the IP address is router in the way, if overtime the replying of TTL that router sends in the way then goes to step 105; Router in the way then is overtime the replying or the overtime upper limit that reaches preset of replying of TTL of TTL that target terminal sends, and just accomplishes whole route and detects.
The IP address of step 105, record router, and TTL added 1, return step 102.
The SOCK_RAW parameter among original Traceroute that this embodiment has been used the SOCK_DGRAM parameter substitution has been walked around use and management person's authority.Because the SOCK_RAW parameter can let application program that the Ethernet header is had complete control; Therefore can bring comparatively serious safety problem (such as forging MAC Address); So have only the root authority just can be provided with; But the head that SOCK_DGRAM can only the control transmission layer does not have any potential safety hazard, therefore can open to application layer and use.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with this technological people in the technical scope that the present invention disclosed; The variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (1)

1. the method that the network route detects is applicable to mobile Internet, it is characterized in that, may further comprise the steps:
A, source terminal be according to the address of target terminal, uses the SOCK_DGRAM parameter to set up the ICMP bag that a life span is 1 echo acknowledgement type;
B, source terminal send said ICMP bag to target terminal, and source terminal is waited for overtime the replying of life span of router in target machine or the way;
After C, source terminal receive the response packet of router in target terminal or the way; Extract and analyze the IP address in the said response packet, if overtime the replying of life span that router sends in the way, the IP address of then writing down said router; And life span is added 1, return step B; Reply or the overtime upper limit that reaches preset of replying of life span if the life span that target terminal sends is overtime, then accomplish whole route and detect.
CN201110338471XA 2011-11-01 2011-11-01 Method for detecting network routing Pending CN102625332A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110338471XA CN102625332A (en) 2011-11-01 2011-11-01 Method for detecting network routing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110338471XA CN102625332A (en) 2011-11-01 2011-11-01 Method for detecting network routing

Publications (1)

Publication Number Publication Date
CN102625332A true CN102625332A (en) 2012-08-01

Family

ID=46564976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110338471XA Pending CN102625332A (en) 2011-11-01 2011-11-01 Method for detecting network routing

Country Status (1)

Country Link
CN (1) CN102625332A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516615A (en) * 2013-07-15 2014-01-15 中国人民解放军国防科学技术大学 Method and device for determining network topology
CN103516615B (en) * 2013-07-15 2016-11-30 中国人民解放军国防科学技术大学 Network topology determines method and apparatus
US9686139B2 (en) 2013-10-25 2017-06-20 Xiaomi Inc. Method and networking device for setting network connection parameters
CN110336716A (en) * 2019-07-15 2019-10-15 哈尔滨工业大学 A kind of efficient destination host end hop router detection method
CN110493848A (en) * 2019-08-20 2019-11-22 赛尔网络有限公司 User terminal routes monitoring method, device, system and the medium of IP variation
CN114071544A (en) * 2021-11-01 2022-02-18 北京字节跳动网络技术有限公司 Network testing method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VASILIY KULIKOV: "[PATCH v3] net:ipv4:add IPPROTO_ICMP", 《LKML.ORG》 *
杜宇明: "ICMP协议及其网络测试工具的设计", 《安徽广播电视大学学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516615A (en) * 2013-07-15 2014-01-15 中国人民解放军国防科学技术大学 Method and device for determining network topology
CN103516615B (en) * 2013-07-15 2016-11-30 中国人民解放军国防科学技术大学 Network topology determines method and apparatus
US9686139B2 (en) 2013-10-25 2017-06-20 Xiaomi Inc. Method and networking device for setting network connection parameters
CN110336716A (en) * 2019-07-15 2019-10-15 哈尔滨工业大学 A kind of efficient destination host end hop router detection method
CN110336716B (en) * 2019-07-15 2022-05-06 哈尔滨工业大学 High-efficiency target host end-hop router detection method
CN110493848A (en) * 2019-08-20 2019-11-22 赛尔网络有限公司 User terminal routes monitoring method, device, system and the medium of IP variation
CN114071544A (en) * 2021-11-01 2022-02-18 北京字节跳动网络技术有限公司 Network testing method and device and electronic equipment
CN114071544B (en) * 2021-11-01 2024-03-15 北京字节跳动网络技术有限公司 Network testing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US10958543B2 (en) Monitoring wireless access point events
CN103220161B (en) A kind of detection method of server state and device
CN111130931B (en) Detection method and device for illegal external connection equipment
US10116546B2 (en) OAM packet processing method, network device, and network system
US10652211B2 (en) Control device, border router, control method, and control program
CN104796298A (en) SDN (Software Defined Network) network fault analyzing method and device
CN113411260A (en) Method and device for sending data message in IPv6 network
CN102307119B (en) Method for discovering probe failure in Internet performance measurement system
CN104065508A (en) Application service health examination method, device and system
CN102625332A (en) Method for detecting network routing
CN105577669A (en) Method and device for identifying false source attack
CN107682262B (en) Communication path processing method and device
CN108924000B (en) Novel network path detection method realized based on TCP protocol
JP2015023463A (en) Packet analyzing device, packet analyzing method, and packet analyzing program
CN116708148B (en) Network diagnosis method and electronic equipment
CN104506358A (en) SNMP (simple network management protocol) based network management system and network management method
CN110166518B (en) Session information transmission method, device, storage medium and electronic device
US8811233B2 (en) Topology detection method and topology detection apparatus
US9912557B2 (en) Node information detection apparatus, node information detection method, and program
CN105025028B (en) The black holes IP based on flow analysis find method
CN101888310A (en) UDP message-based IP path active measurement method
CN104158735A (en) Network data package distribution method and device
JP2013243534A (en) Delay time evaluation device and method for evaluating delay time
CN106789256B (en) Test system and test method for simulating wide area network environment
TWI558141B (en) A lightweight real - time active call method and module for passive communication protocols

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100085 Beijing city Haidian District Qinghe Street No. 68 Huarun colorful city shopping center two floor 13

Applicant after: Xiaomi Technology Co., Ltd.

Address before: 100102, Beijing, Wangjing, Chaoyang District West Road, No. 50, -1 volume stone world building, block A, 12

Applicant before: Beijing Xiaomi Technology Co., Ltd.

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120801