The following is the fourth installment of a multi-part series on the fundamentals of routing. Each tip is excerpted from Routing First-Step by William Parkhurst, published by Cisco Press. Check back frequently for the next installment, or go to the main series page for all the installments. Show Unlike the post office, a router or computer cannot determine the size of a package without additional information. A person can look at a letter or box and determine how big it is, but a router cannot. Therefore, additional information is required at the IP layer, in addition to the source and destination IP addresses. Figure 3-12 is a logical representation of the information that is used at the IP layer to enable the delivery of electronic data. This information is called a header, and is analogous to the addressing information on an envelope. A header contains the information required to route data on the Internet, and has the same format regardless of the type of data being sent. This is the same for an envelope where the address format is the same regardless of the type of letter being sent. Figure 3-12 - IP Header Format The fields in the IP header and their descriptions are
The IP Precedence field can be used to prioritize IP traffic. (See Table 3-9.) This is the same as the postal system having different classes of mail such as priority, overnight, and 2-day delivery. Routers can choose to use this field to give preferential treatment to certain types of IP traffic. Table 3-9 - IP Precedence ValuesThe ToS bits were originally designed to influence the delivery of data based on delay, throughput, reliability and cost. (See Table 3-10.) They are usually not used and are therefore set to zero. Table 3-10 - Type of Service ValuesThe IP Precedence field can have 8 or 23 possible values. Routers use two of these values, 6 and 7, for routing protocol traffic. That leaves six values that can be used to prioritize user traffic. Because the ToS bits are typically not used, the IP Precedence field can be extended from 3 to 6 bits by using 3 bits from the ToS field. (See Figure 3-13.) This new field is called the Differentiated Services Code Point (DSCP). That gives you 64 or 26 possible values that can be used to prioritize traffic. Although there are 64 possible DSCP values, only 14 are used typically. (See Table 3-11 and the explanation that follows.) Table 3-11 Differentiated Services Code Point Values Notice that the first 3 bits of the DSCP value are the 3 bits from the IP precedence. An IP precedence of 000 maps into a DSCP value of 000 000, and both represent best effort delivery. An IP precedence of 101 (Critical) maps into a DSCP value of 101 110 (High Priority or Expedited Forwarding). The remaining 4 IP precedence values are each mapped into 3 DSCP values. The additional 3-bit portion is used to identify a drop probability within one of the four assured forwarding (AF) classes. This discussion of the contents of the IP header is meant as an overview. If you are interested in learning more details regarding the IP header, refer to the references at the end of this chapter. The important concept to take away from this discussion is that the IP header contains the source and destination IP addresses. Routers use the destination IP address to determine a route; therefore, the IP layer in the layered model is the routing layer. At this point, we could stop our discussion of the layered protocol model. This book is about routing, and routing is the second or third layer depending on which model is used. A router does not care what application sent the data, or how the application is going to receive the data. The job of the router is to get the packet to the proper destination. It is then the responsibility of the destination host to deliver the data to the application. The incomplete layered model in Figure 3-8 is sufficient for the remainder of this book. But, to be complete, let's go ahead and finish the model. All parts reproduced from the book Routing First-Step, ISBN 1587201224, Copyright 2005, Cisco Systems, Inc. Reproduced by permission of Pearson Education, Inc., 800 East 96th Street, Indianapolis, IN 46240. Written permission from Pearson Education, Inc. is required for all other uses. Visit www.ciscopress.com for a detailed description and to learn how to purchase this title. Time-to-live in networking refers to the time limit imposed on the data packet to be in-network before being discarded. It is an 8-bit binary value set in the header of Internet Protocol (IP) by the sending host. The purpose of a TTL is to prevent data packets from being circulated forever in the network. The maximum TTL value is 255. The value of TTL can be set from 1 to 255 by the administrators. The usage of TTL in computing applications lies in the performance improvement and management of data caching. It also finds its use in Content Delivery Network (CDN) caching and Domain Name System (DNS) caching. The number of hops a packet travels before being discarded by a network is known as the time to live (TTL) or hop limit. The maximum range for packets is indicated by TTL values.
Thus, using the TTL value there is a restriction on the duration for which the data exists on the network. Furthermore, it also helps to find out the period of data for which it has been on the network and how long it will be on the network. In the scenario below, Host A wishes to interact with Host B using a ping packet. Host A uses a TTL of 255 in the ping and transmits it to Router A, its gateway. When Router A notices that the packet is going for a layer 3 i.e. Network layer, it hops to Router B, reduces the TTL by 255 – 1 = 254, and delivers it to Router B. Router B and Router C decrement the TTL in the same way. Router B decrements TTL in a packet from 254 to 253 and Router C decrements the TTL from 253 to 252. The ping packet TTL is decreased to 252 when it reaches Host B. Whenever TTL reaches the value of zero, TTL=0 then the packet is discarded by the router, and the Time Exceeded Error message is sent to the originating host. Time-to-Live (TTL) in DNS:DNS TTL refers to the time taken by DNS for caching a record. In other words, the duration for which a DNS record is to be kept or the time it takes for a DNS record to be returned from the cache is referred to as time-to-live. It is a numerical value set in a DNS record on the domain’s authoritative domain name server. It specifies the number of seconds for which a cache server can provide the record’s cached value. When the set time has elapsed since the previous refresh, the caching server will contact the authoritative server to obtain the current and possibly updated value for the record. Time-to-Live (TTL) in HTTP:TTL is measured in seconds and is set by HTTP headers such as the Cache-Control header. If the value is set to “Cache-Control: max-age=60” then it implies refreshing a given resource every 60 seconds before the time to live is surpassed. The setting “max-age=0,” implies that the resource should not be cached at all. Time to live field has a direct impact on page load time (cached data loads faster) and content freshness on your site (i.e., data cached for too long can become stale). TTLs should be configured as follows to ensure that your visitors only see the most recent version of your website:
What is time-to-live (TTL) exceeded?IP packets delivering web HTTP traffic over TCP (Transmission Control Protocol) that have traveled too many network hops are referred to as TTL exceeded. When this situation arises then each router Each router reduces the TTL field of IP packets sent over the network until it reaches 0. The router then drops the IP packet and sends an ICMP packet with a TTL exceeded error code to the sending host. Application of time-to-live (TTL):The TTL value is used in the network utilities such as ping, traceroute, and pathping.
TTL: Time Limit or Hop Limit?In IPv6, it is known as hop limit and in IPv4, it is known as TTL. The Hop field is same as the TTL field in IPv4. The hop count function is necessary for network operation. It prevents networks from collapsing as a result of packets looping indefinitely. Transport protocols like TCP use the time limit function to ensure that data is transferred reliably. Even if the elapsed time was significantly less than a second, every router that handles a packet must reduce the TTL by at least one. In this perspective, Time-to-Live serves as a hop counter. So, it puts a limit on how far a datagram can propagate via the Internet. Common TTL Values:Normally, the TTL value is 86400 seconds or 24 hours. MX and CNAME records, on the other hand, can have a longer TTL because they are expected to change infrequently. It is recommended that you set TTL to 1 hour if your service is vital (3600 seconds). Shorter TTLs can put a strain on an authoritative name server, but they can be advantageous when changing the address of key services like web servers or MX records. As a result, DNS administrators often reduce TTLs before moving services to avoid interruptions. |