The TTL in IP protocol is detailed

Source: Internet
Author: User

Traceroute uses ICMP and ttl,icmp for Echo information, including ip,ttl,sequence number, and so on. The TTL field is the initial set field of the sender, the RFC specifies a value of 64, for each router that processes the packet needs to reduce the value of TTL 1 or less time spent in the router, the general router forwarding packet delay of not more than 1s, so the TTL can be counted as the count of hops.

If the router receives an IP packet with a TTL value of 0 or 1, the router will not forward the packet, discarding the packet and sending the ICMP timeout information. The source address of the IP message containing the ICMP information is the IP address of the router. The traceroute can be used as a tool for tracing the gateway, as long as the setting is set to a reasonable TTL value. Send a datagram with a TTL value of 1, the first router will reduce the TTL value by 1, discard the datagram, and send the ICMP timeout information, get the IP of the first router, with the barber sent a TTL value of 2 of the datagram to get the address of the second router. Continue this process until the data is reported to the destination host, but even if the destination host receives an IP message with a TTL value of 1, it will not discard the datagram and send ICMP packets, because the datagram has reached the destination, how to determine whether the destination host has been reached? Send a copy of the UDP datagram to the destination host, where UDP uses a port number that is unreachable, based on whether the ICMP message is timed out or if the port is not up to the destination host.

The Linux system TTL value modification location is/proc/sys/net/ipv4/ip_default_ttl,

echo >/proc/sys/net/ipv4/ip_default_ttl

(This is transient) to set long-lasting can:

Modify the/etc/sysctl.conf configuration file and add the following line

net.ipv4.ip_default_ttl=128

The TTL in IP protocol is detailed

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.