Module 3
Module 3
Version
Contains a 4-bit binary value set to 0100 that identifies this as an IPv4
packet.
Internet header length
A 4-bit field containing the length of the IP header.
The minimum length of an IP header is 20 bytes.
Differentiated service or Diffserv (DS)
Formerly called the Type of Service (ToS) field, the DS field is an 8-bit
field used to determine the priority of each packet.
The six most significant bits of the DiffServ field are the Differentiated
Services Code Point (DSCP).
The last two bits are the Explicit Congestion Notification (ECN) bits.
Total length
Specifies the length of the IP packet including the IP header and the
user data.
The total length field is 2 bytes, so the maximum size of an IP packet
is 65,535 bytes; however, packets are much smaller in practice.
Identification, flag and fragment offset
As an IP packet moves through the internet, it might need to cross a
route that cannot handle the size of the packet.
The packet will be divided, or fragmented, into smaller packets and
reassembled later.
These fields are used to fragment and reassemble packets.
Time-to-live (TTL)
Contains an 8-bit binary value that is used to limit the lifetime of a
packet.
The packet sender sets the initial TTL value, and it is decreased by
one each time the packet is processed by a router.
If the TTL field decrements to zero, the router discards the packet and
sends an Internet Control Message Protocol (ICMP) Time Exceeded
message to the source IP address.
Protocol
Field is used to identify the next level protocol.
This 8-bit binary value indicates the data payload type that the
packet is carrying, which enables the network layer to pass the data
to the appropriate upper-layer protocol.
Common values include ICMP (1), TCP (6), and UDP (17).
Header checksum
A value that is calculated based on the contents of the IP header.
Used to determine if any errors have been introduced during
transmission.
Source IPv4 address
Contains a 32-bit binary value that represents the source IPv4
address of the packet.
The source IPv4 address is always a unicast address.
Destination IPv4 address
Contains a 32-bit binary value that represents the destination IPv4
address of the packet.
Options and padding
This is a field that varies in length from 0 to a multiple of 32 bits.
If the option values are not a multiple of 32 bits, 0s are added, or
padded, to ensure that this field contains a multiple of 32 bits.
Version
This field contains a 4-bit binary value set to 0110 that identifies this
as an IPv6 packet.
Traffic Class
This 8-bit field is equivalent to the IPv4 Differentiated Services (DS)
field.
Flow label
This 20-bit field suggests that all packets with the same flow label
receive the same type of handling by routers.
Payload length
This 16-bit field indicates the length of the data portion or payload of
the IPv6 packet.
Next header
This 8-bit field is equivalent to the IPv4 Protocol field.
It indicates the data payload type that the packet is carrying, enabling
the network layer to pass the data to the appropriate upper-layer
protocol.
Hop limit
This 8-bit field replaces the IPv4 TTL field.
This value is decremented by a value of 1 by each router that
forwards the packet.
When the counter reaches 0, the packet is discarded, and an ICMPv6
Time Exceeded message is forwarded to the sending host, indicating
that the packet did not reach its destination because the hop limit
was exceeded.
Source IPv6 address
This 128-bit field identifies the IPv6 address of the sending host.
Destination IPv6 address
This 128-bit field identifies the IPv6 address of the receiving host.
An IPv6 packet may also contain extension headers (EH) that provide
optional network layer information. Extension headers are optional and are
placed between the IPv6 header and the payload. EHs are used for
fragmentation, security, to support mobility, and more.
Unlike IPv4, routers do not fragment routed IPv6 packets.
3.2 IP Vulnerabilities
3.2.1 IP Vulnerabilities
There are different types of attacks that target IP. The following lists some of
the more common IP-related attacks.
ICMP attacks
Threat actors use Internet Control Message Protocol (ICMP) echo packets
(pings) to discover subnets and hosts on a protected network, to generate
DoS flood attacks, and to alter host routing tables.
Denial-of-service (DoS) attacks
Threat actors attempt to prevent legitimate users from accessing
information or services.
Distributed Denial-of-Service (DDoS) attacks
Similar to a DoS attack, but features a simultaneous, coordinated attack
from multiple source machines.
Address spoofing attacks
Threat actors spoof the source IP address in an attempt to perform blind
spoofing or non-blind spoofing.
Man-in-the-middle attack (MiTM)
Threat actors position themselves between a source and destination to
transparently monitor, capture, and control the communication. They could
simply eavesdrop by inspecting captured packets or alter packets and
forward them to their original destination.
Session hijacking
Threat actors gain access to the physical network, and then use an MiTM
attack to hijack a session.
Note: ICMP for IPv4 (ICMPv4) and ICMP for IPv6 (ICMPv6) are susceptible to
similar types of attacks.
The following lists common ICMP messages of interest to threat actors.
ICMP echo request and echo reply
This is used to perform host verification and DoS attacks.
ICMP unreachable
This is used to perform network reconnaissance and scanning attacks.
The switch overwrites the current CAM table entry and assigns the MAC
address to the new port, as shown in the figure. It then forwards frames
destined for the target host to the attacking host.
Switch Updates CAM Table with Spoofed Address
Application or service spoofing is another spoofing example. A threat actor
can connect a rogue DHCP server to create an MiTM condition.