Ttl ??

Discussion in 'Windows Desktop Systems' started by dreamworks, Apr 19, 2005.

  1. dreamworks

    dreamworks --== babyface ==--

    Messages:
    355
    Hi guys ..

    I hope to understand more about Time To Live please? What exactly is TTL in a network?

    Lets say for example my wireless broadband, the package which is offered is 1Mbps/256kbps and when I ping the local isp, my TTL=249. Is this good or bad?

    :rolleyes: Appreciate any advise. Thanks.
     
  2. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    TTL is a one of the fields in the header of an IP datagram. Basically, the purpose of the field is to make sure the datagram doesn't circulate around the network forever. It's decremented each time the datagram is processed by a router along the way, and if the TTL field reaches 0, the datagram is dropped.
     
  3. dreamworks

    dreamworks --== babyface ==--

    Messages:
    355
    Ok .. so if thats the case, the longer it is the better or the shorter it is the better.

    For eg. situation A, TTL=1500, situation B, TTL=750 and situation C, TTL=250.

    Of the above, which is considered to be "Good" connection? Also, does an internal router plays any role in the TTL? I still don't quite get what is the function of TTL?? :)
     
  4. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    There's no "better" or "worse" as such :)

    The TTL field in the header is arbitrarily set by the particular application that's sending out the packet. So for example, 'traceroute' sends out packets with smaller TTL values than 'ping'

    Since the purpose of traceroute is to tell you which routers your packets travel through, the utility sets the TTL of the first packet to 1. When the packet reaches the first router, it's decremented to 0 and dropped, and the router sends a message back to the host. Traceroute uses this information to print the IP/hostname of the first router. It then sends a second packet with a TTL of 2, and now the second router in the path drops the packet and sends back a message. The next packet has a TTL of 3 and so on. This goes on until the packet reaches the final destination router (unless the destination is unreachable). This way traceroute can display information about each router that the packet visited in it's journey from the source to the destination.

    Do you have a better idea of the purpose and how it works now? :)
     
  5. gonaads

    gonaads Beware the G-Man Political User Folding Team

    Damn, I sure do. :)
     
    Last edited: Apr 19, 2005
  6. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Awesome. :D
     
    gonaads likes this.
  7. gonaads

    gonaads Beware the G-Man Political User Folding Team

    So basically kinda like mile markers. Or router markers, counting down to the destination?
     
  8. gonaads

    gonaads Beware the G-Man Political User Folding Team

    The app knows how many it is to the destination. Or does it guesstemate it?
     
  9. LordOfLA

    LordOfLA Godlike!

    Messages:
    7,027
    Location:
    Maidenhead, Berkshire, UK
    there is a default ttl set by <insert os here> in somecases its hardcoded and in others its user changeable.

    If an application doesnt specify a ttl then the os default is applied, otherwsie an application can specify the ttl.

    however if you set the ttl too high you'll increase latancy as your packet could then potentially take a longer route depending on how the "in-between" routers are configured.
     
    gonaads likes this.
  10. dreamworks

    dreamworks --== babyface ==--

    Messages:
    355
    I see .. so basically if its 249, it basically means the packet has travelled through 249 routers just to reach the destination?
     
  11. gonaads

    gonaads Beware the G-Man Political User Folding Team

    Ya learn more and more every day. :)
     
  12. DwarfData

    DwarfData OSNN Addict

    Messages:
    135
    Location:
    Lancashire, UK
    As I understand what's been said, no. If the default ttl is set to 250 then the packet has travelled through 1 router (250-249), where as if the default ttl was set to 500 then the packet has traveleld through 251 routers (500-249)
     
  13. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    No. TTL counts down. The standard number is probably 255 (8 bits maxed out, I think it's the maximum value). So 249 means 6 routers. The hop chains are rarely very long, the maximum length for traceroute (in Windows anyway) is 30 hops. My route to OSNN for instance (Sweden -> US) is 18 hops. You usually never need to care about the TTL as it's just a maximum limit to tell the routers when to drop a packet that has clearly gotten stuck in a loop.
     
  14. gonaads

    gonaads Beware the G-Man Political User Folding Team



    But... as was said, it counts down to zero.

    That being said, 500=500 not 251. Count down from 500 to 0 = 500 (don't count zero :D)
     
  15. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    No, it means the packet has visited either 3 or 6 routers (depending on the OS version of the destination host) to reach the destination. Remember that the TTL value is decremented at each router.

    When you issue the ping command, your machine sends out a packet to the server. The server then sends back a response packet with an initial TTL value of 255 (most recent systems do this). The response packet visits 6 routers on the way back to you. When your machine receives the packet, it reads the TTL value in the response packet, which is 255 - 6 = 249; i.e., there are 6 routers between you and the destination.

    On certain older systems, the TTL value of the response packet would be set to the same as the value in the packet that the host received. In this case, if the TTL value displayed by your system was 255 - 6 = 249, the 6 would represent the total number of routers visited during the round-trip (not one-way); i.e., there are 3 routers between you and the destination - 3 hops on the way up, 3 more on the way down.

    :)

    Edit: Three other posts in the time it took to type this. :D
     
    Last edited: Apr 19, 2005
  16. gonaads

    gonaads Beware the G-Man Political User Folding Team


    So what is the default per router, or hop?

    Is each hop a router?
     
  17. DwarfData

    DwarfData OSNN Addict

    Messages:
    135
    Location:
    Lancashire, UK
    A bit of misunderstanding I think.

    If the default ttl is 500, i.e. the maximum allowed, but when you ping you get a ttl value of 249 then, counting down from 500 that's 251 hops.
     
  18. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Yes.
     
  19. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    from http://www.faqs.org/rfcs/rfc3682.html
     
  20. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Yep. The TTL field in the IP header is 8 bits.
    Maximum value = (2^8) - 1 = 255