ccna-notes4-day10
IPv4 Header - IHL , internet header length
- length : 4 bits
- increments: of 4 byte minimum value is 5 (5x4= 20) maximum value is 15 (15x4 = 60 bytes) 4 bits ⇒ 1 1 1 1 8+4+2+1=15 (max), 15*4 = 60 bytes MINIMUM IPv4 HEADER LENGTH = 20 BYTES MAXIMUM IPv4 HEADER LENGTH = 60 BYTES
DSCP field Differentiated Services Code Point length : 6 bits
- Used for QoS (Quality of Service)
- Used to prioritize delay-sensitive data (streaming voice, video, etc.)
ECN field Explicit congestion notification length : 2bits
- Provides end-to-end (between two endpoints) notificati of network congestion without dropping packets.
- Optional feature that requires both endpoints, as well as the underlying network infrastructure, to support it.
Total Length field(last part) length : 16 bits or 2 octect
Indicates the total length of the packet (L3 header + L4 segment) Measured in bytes (not 4-byte increments like IHL) Minimum value of 20 (=IPv4 header with no encapsulated data) The IPv4 header consists of a fixed part (which is 20 bytes) and an optional part (if there are options like security features, timestamps, etc.). The fixed IPv4 header without any options is 20 bytes (or 160 bits). The field that stores the size of the IPv4 header in the IP header is called IHL (Internet Header Length), which is 4 bits long and tells you the number of 4-byte (32-bit) blocks the header occupies. The minimum value for IHL is 5 (which corresponds to 5 blocks of 4 bytes each, or 20 bytes). Maximum values of 65,535(maximum 16-bit value) the maximum value is 2n−1. For 16 bits, it’s 2^16−1=65,535216−1=65,535.
how many bits of length? 16 how to conver 16 bits to maximum value? 2^16 -1
Identication field
If a packet is fragmented due to being too large, this field is used to identify which packet the fragment belongs to. All fragments of the same packet will have their own [Pv4 header with the same value in this field.
Packets are fragmented if larger than the MTU maximum transmittion unit
The MTU is usually 1500 bytes Remember the maximum size of an Ethernet fran Fragments are reassembled by the receiving host
Flags field length: 3 bits
Used to control/identify fragments.
Bit O: Reserved, always set to O
Bit 1: Don’t Fragment (DF bit), used to indicate a packet that should not be fragmented
Bit 2: More Fragments (MF bit), set to 1 if there are more fragments in the packet, set to O for the last fragment
unfragmented packets will always have their MF(more fragment) bits set to 0
Fragment offset field length : 13 bits
Used to indicate the position of the fragment within the original, unfragmented IP packet. Allows fragmented packets to be reassembled even if the fragments arrive out of order.
- seems like to unit that storing of order of the fragment
Time to live field (TTL) length: 8 bits
A vouter will drop a packet with a TTL of O
Used to prevent infinite loops
Originally designed to indicate the packet’s maximum lifetime in seconds
In practice, indicates a ‘hop count’: each time the packet arrives at a router, the router decreases the TTL by 1.
-
Recommended default TTL is 64
-
seems like a for loop (n)
Protocal field length 8 bits
Indicates the protocol of the encapsulated L4PDU
- Value of 6: TCP
- Value of 17: UDP
- Value of 1: ICMP
- Value of 89: OSPF ( dynamic routing protocol)
Header Checksum field length : 16 bits
A caleulated checksum used to check for errors in the IPv4 header.
When a router receives a packet, it calculates the checksum of the header and compares it to the one in this field of the header.
If they do not match, the router drops the packet.
- used to check for errors only in IPv4 header
- IP relies on the encapsulated protocol to detect errors the encapsulated data
- Both TCP and UDP have their own checksum fields to detect ervors in the encapsulated data.
Source / destination IP address fields length : 32 bits Source IP Address = IPv4 address of the sender of the packet. Destination IP Address = IPv4 address of the intended receiver of the packet.
Options fields length: 0 - 320 bits 40 bytes
- Rarely used.
- If the IHL field is greater than 5, it means that Options are present.
using wireshark packet captuer
- learing
Header checksum: 0x3840 [validation disabled] - 0x ⇒ heximal - each heximal = 4 bits - 4 heximal = 4x4 bits (16 bits) Header checksum status: Unverified
How are ervors in an [Pv4 packet’s encapsulated data detected? a) The IPv4 Header Checksum field checks for errors. b) The encapsulated protocol (TCP, UDP) checks for errors ¢) Ervors in the encapsulated data cannot be detected
ans : B 🦉
- The IPv4 Header Checksum field only checks for errors in the IPv4 header itself. However, Layer 4 protocols like TCP or UDP can use their checksum to check for errors the encapsulated data.
Which field of an IPv4 header is variable in length?
a) Options b) Header Checksum ¢) Total Length d) IHL
ans : a
The Options field can vary in length from O bits to 320 bits. The other fields are fixed-length. Although the Total Length and IHL fields are used to represent the variable length of the IPv4 header and packet, the fields themselves are fixed in length.
Which bit will be set to 1 on all IPv4 packet fragments except the last
fragment?
a) Fragment Offset bit b) More Fragments bit ¢) Don’t Fragment bit 100 d) Packet Fragment bit <)
ans: b The More Fragments bit, part of the Flags field of the IPv4 header, is used to indicate that the current fragment is not the last fragment of a fragmented packet. Itis set to 1 on all fragments except the last, which will setit to 0.
Convert the decimal 6 to binary:(IPv6 case)
To convert decimal 6 into binary:
6 ÷ 2 = 3, remainder 0
3 ÷ 2 = 1, remainder 1
1 ÷ 2 = 0, remainder 1
Reading the remainders from bottom to top, we get 110.
But, since the version field is 4 bits long and we need to represent 6, we add a leading zero to make it a 4-bit number: 0110.
opposite:
0110 (binary) = 6 (decimal)