IP - Internet Protocol v4/v6
The Internet Protocol (IP) is a L3 network layer protocol, for routing and addressing packets of data so that they can travel across networks and arrive at the correct destination.
IP has the task of delivering packets from the source host to the destination host solely based on the IP addresses in the packet headers.
Header usualy is 20 bytes long (it can be extended up to 60 bytes with IPv4 options), most important fields:
Version and header length - (1 byte) version - 4, length - 4 bytes
DSCP: (1 byte)
Length of packet: 2 bytes
ID: (2 bytes)
DF bit: 3 bits + DF offset: 13 bits (2 bytes in total)
TTL: 1 byte
Next protocol: 1 byte
Header checksum: 2 bytes
Src IP: 4 bytes
Dts IP: 4 bytes
Options (if included): option type: 1 byte, 1 option length (1 byte), option data ( up to 38 bytes) - max 40 bytes
Usualy:
[ dmac(6)+smac(6)+etype(2)+ [ header (20) + payload (1480)] + crc(4) ] = 1518 bytes
/* Check fragmentation
section
Ethernet II
Destination: Cisco_e1:a0:68 (2c:54:2d:e1:a0:68)
Source: Apple_b7:a6:ec (6c:7e:67:b7:a6:ec)
Type: IPv4 (0x0800)
Internet Protocol Version 4
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 67
Identification: 0x0000 (0)
010. .... = Flags: 0x2, Don't fragment
0... .... = Reserved bit: Not set
.1.. .... = Don't fragment: Set
..0. .... = More fragments: Not set
...0 0000 0000 0000 = Fragment Offset: 0
Time to Live: 64
Protocol: UDP (17)
Header Checksum: 0xd966
Header checksum status: Unverified
Source Address: 10.13.13.122
Destination Address: 142.250.186.194