www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192
The best way to understand IPv4 is to know the IPv4 header and all its fields. Segments from TCP or the User Datagram Protocol (UDP) are passed on to IP for processing. The IP header is appended to the TCP or UDP segment. The TCP or UDP segment then becomes the IP data. The IPv4 header is 20 bytes in length when it uses no optional fields. The IP header includes the addresses of the sending host and destination host. It also includes the upper-layer protocol, a field for prioritization, and a field for fragmentation. Figure 7-1 shows the IP header format.
- Total length— This field is 16 bits in length. It represents the length of the datagram or packet in bytes, including the header and data. The maximum length of an IP packet can be 216 – 1 = 65,535 bytes. Routers use this field to determine whether fragmentation is necessary by comparing the total length with the outgoing MTU.
- Protocol— This field is 8 bits in length. It indicates the upper-layer protocol. The Internet Assigned Numbers Authority (IANA) is responsible for assigning IP protocol values. Table 7-2 shows some key protocol numbers. A full list can be found at http://www.iana.org/assignments/protocol-numbers.
Table 7-2. IP Protocol Numbers
Protocol Number Protocol 1 Internet Control Message Protocol (ICMP) 2 Internet Group Management Protocol (IGMP) 6 Transmission Control Protocol (TCP) 17 User Datagram Protocol (UDP) 88 Enhanced IGRP (EIGRP) 89 Open Shortest Path First (OSPF) 103 Protocol-Independent Multicast (PIM)
- Source address— This field is 32 bits in length. It is the sender's IP address.
- Destination address— This field is 32 bits in length. It is the receiver's IP address.
Table 7-3 summarizes the fields of the IP header.
ToS
The ToS field of the IP header is used to specify QoS parameters. Routers and layer 3 switches look at the ToS field to apply policies, such as priority, to IP packets based on the settings. The ToS field has undergone several definitions since RFC 791.
The first 3 (leftmost) bits are the IP precedence bits. These bits define values that are used by QoS methods. The precedence bits especially help in marking packets to give them differentiated treatment with different priorities. For example, Voice over IP (VoIP) packets can get preferential treatment over regular data packets. RFC 791 describes the precedence bits as shown in Table 7-4.
| Decimal | Binary | Description |
|---|---|---|
| 0 | 000 | Routine |
| 1 | 001 | Priority |
| 2 | 010 | Immediate |
| 3 | 011 | Flash |
| 4 | 100 | Flash override |
| 5 | 101 | Critical |
| 6 | 110 | Internetwork control |
| 7 | 111 | Network control |
All default traffic is set with 000 in the precedence bits. Voice traffic is usually set to 101 (critical) to give it priority over normal traffic. Applications such as FTP are assigned a normal priority because it tolerates network latency and packet loss. Packet retransmissions are typically acceptable for normal traffic.
RFC 1349 redefined Bits 3 and 6 (expanding for ToS bits) to reflect a desired type of service optimization. Table 7-5 shows the ToS field values that indicate service parameters to use for IP packets.
| ToS Bits 3 to 6 | Description |
|---|---|
| 0000 | Normal service |
| 1000 | Minimize delay |
| 0100 | Maximize throughput |
| 0010 | Maximize reliability |
| 0001 | Minimize monetary cost |
In 1998, RFC 2474 redefined the ToS octet as the Differentiated Services (DS) field and further specified bits 0 through 5 as the Differentiated Services Codepoint (DSCP) to support differentiated services. RFC 3168 (2001) provides updates to RFC 2474 with the specification on an Explicit Congestion Notification (ECN) field.
The DS field takes the format shown in Figure 7-2. The DS field provides more granular levels of packet classification by using 6 bits for packet marking. DS has 26 = 64 levels of classification, which is significantly higher than the eight levels of the IP precedence bits. These 64 levels are called codepoints, and they have been defined to be backward-compatible with IP precedence values. The network designer uses DSCP to give priority to IP packets using Cisco routers. Routers should be configured to map these codepoints to per-hop behaviors (PHB) with queuing or other bandwidth-management techniques. Table 7-6 compares DSCP and IP precedence values used to assign priority and apply policies to IP packets.
RFC 2597 defines recommended values for AF codepoints with low, medium, and high packet drop precedence. Table 7-7 shows the recommended AF codepoint values.
| Precedence | AF Class 1 | AF Class 2 | AF Class 3 | AF Class 4 |
|---|---|---|---|---|
| Low drop precedence | 001010 | 010010 | 011010 | 100010 |
| Medium drop precedence | 001100 | 010100 | 011100 | 100100 |
| High drop precedence | 001110 | 010110 | 011110 | 100110 |
IPv4 Fragmentation
One of the key characteristics of IPv4 is fragmentation and reassembly. Although the maximum length of an IP packet is 65,535 bytes, most of the common lower-layer protocols do not support such large MTUs. For example, the MTU for Ethernet is approximately 1518 bytes. When the IP layer receives a packet to send, it first queries the outgoing interface to get its MTU. If the packet's size is greater than the interface's MTU, the layer fragments the packet.
When a packet is fragmented, it is not reassembled until it reaches the destination IP layer. The destination IP layer performs the reassembly. Any router in the path can fragment a packet, and any router in the path can fragment a fragmented packet again. Each fragmented packet receives its own IP header and is routed independently from other packets. Routers and layer 3 switches in the path do not reassemble the fragments. The destination host performs the reassembly and places the fragments in the correct order by looking at the identification and fragment offset fields.
If one or more fragments are lost, the entire packet must be retransmitted. Retransmission is the responsibility of the higher-layer protocol (such as TCP). Also, you can set the Flags field in the IP header to "Do Not Fragment" the packet. If the field indicates Do Not Fragment, the packet is discarded if the outgoing MTU is smaller than the packet.
No comments:
Post a Comment