我對電腦網路中的 TTL 有疑問
根據 JAMES F. KUROSE 在《電腦網路 - 自上而下的方法》一書中的說法
Time -to-live- The time-to-live (TTL) field is included to ensure that datagrams
do not circulate forever (for example, a long-lived routing loop) in the network.
This field is decremented by one each time the datagram is processed by a router.
If the TTL field reaches 0, a router must drop that datagram.
我的問題是是否封包到達目的地時TTL變為0或不為0主機還是還有一些剩餘價值?
我從 UBUNTU 中的 ping 命令中註意到,即使目的地是同一裝置(ping 環回),ping 命令的 TTL=64,如果是這樣,到達目的地時 TTL 不會減少到 0,並且 Windows 已設定 TTL至128。
我的問題是
1)那麼每個 IP 封包的 TTL 是否會根據目的地而改變?還是它是由作業系統為每個資料包預先定義的?
2)當它到達資料包要傳送到的目標主機時,它是否為零?