Monday 19 December 2011

What is Time to Live ( TTL ) value in IP? TTL Value how it is used ? Tutorial on TTL ( Time to Live)

TTL is one of the most basic field on networking. Every person who has some passion to know about networks should know about this field.

The TTL is a 8 bit field present in IP header it is defined in RFC 791.

 Time to Live:  8 bits

This field indicates the maximum time the datagram is allowed to remain in the internet system.  If this field contains the value zero, then the datagram must be destroyed.  This field is modified in internet header processing.  The time is measured in units of seconds, but since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second, the TTL must be thought of only as an upper bound on the time a datagram may exist.  The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime.

Few Important things about TTL ( Time to Live)

1) Time to Live is measured in seconds. Its the time not the counter.the value of 1 means 1 second.

2) The two main uses of TTL : 
  •   To discard the TCP Segment or to limit the life of TCP segment ( TCP RFC 793)
  •   To prevent Routing Loop or to terminate the routing loops 
3)  It is set by the sender to the maximum time the data-gram is allowed to be active in the system.

4) This Field is decreased by every router in the path to destination network.

5) The Router should accept the data-gram even if the TTL value is "0" 

6) Only when the Router has to forward the datagram to next hop and the TTL value is found to be "zero" the router should drop the packet.

7) The router can not originate a packet with TTL value as "0"

Now answer following questions :

1) Why there is no protocol like Spanning tree protocol in Layer 3?

2) How to prevent loops in Layer 3 ?

3) Lets say we have Host PC1 at my place in India and Host PC2 at Alaska USA. Both have public IP and in between we have 500 different router. Please give a command to test the connectivity of both the PC's.

4) What is default TTL value for windows XP machine and Linux Fedora machine ?

Send your answers to Its very simple questions but i have asked them all and got wrong answers every time i ask it in interviews :-)

"Keep Learning , Keep sharing "