0
0
Computer Networksknowledge~10 mins

IP packet structure in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - IP packet structure
Start: IP Packet
Header Fields
Version
Header Length
Type of Service
Total Length
Identification
Flags
Fragment Offset
Time to Live
Protocol
Header Checksum
Source IP Address
Destination IP Address
Options (if any)
Data (Payload)
The IP packet starts with a header containing fields like version, length, and addresses, followed by the data payload.
Execution Sample
Computer Networks
Version: 4
Header Length: 20 bytes
Total Length: 60 bytes
Source IP: 192.168.1.1
Destination IP: 8.8.8.8
Data: 40 bytes payload
This example shows an IPv4 packet with a 20-byte header and 40 bytes of data.
Analysis Table
StepFieldValueDescription
1Version4Indicates IPv4 protocol
2Header Length20 bytesLength of the header, minimum 20 bytes
3Type of Service0Default service, no special priority
4Total Length60 bytesTotal size of packet including header and data
5Identification54321Unique ID for fragmentation
6Flags010Don't fragment flag set
7Fragment Offset0No fragmentation offset
8Time to Live64Packet lifetime before discard
9Protocol6TCP protocol indicated
10Header Checksum0x1c2bError-checking for header
11Source IP Address192.168.1.1Sender's IP address
12Destination IP Address8.8.8.8Receiver's IP address
13OptionsNoneNo options present
14Data40 bytesPayload data carried by packet
15End-Packet fully constructed and ready for transmission
💡 All fields processed; packet ready to send.
State Tracker
FieldInitialAfter Step 1After Step 5After Step 10Final
Version-4444
Header Length--20 bytes20 bytes20 bytes
Total Length---60 bytes60 bytes
Identification--543215432154321
Flags--010010010
Fragment Offset--000
Time to Live---6464
Protocol---66
Header Checksum---0x1c2b0x1c2b
Source IP Address---192.168.1.1192.168.1.1
Destination IP Address---8.8.8.88.8.8.8
Options---NoneNone
Data----40 bytes
Key Insights - 3 Insights
Why is the Header Length important and how does it affect the packet?
Header Length tells how big the header is. It is needed to know where the data starts. In the execution_table at Step 2, the header length is 20 bytes, so data starts after that.
What does the Flags field '010' mean in the packet?
Flags '010' means the 'Don't Fragment' bit is set. This prevents the packet from being split. See Step 6 in the execution_table for this value.
How does the Total Length relate to Header Length and Data size?
Total Length is the sum of Header Length and Data size. In the table, Total Length is 60 bytes (Step 4), Header Length is 20 bytes (Step 2), so Data is 40 bytes (Step 14).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at Step 4. What does the Total Length field represent?
AThe size of the header only
BThe combined size of header and data
CThe size of the data only
DThe size of the options field
💡 Hint
Check Step 2 (Header Length) and Step 14 (Data) to see how Total Length sums them.
At which step in the execution_table is the Source IP Address set?
AStep 11
BStep 9
CStep 13
DStep 15
💡 Hint
Look for the row labeled 'Source IP Address' in the table.
If the Flags field was '000' instead of '010', what would change?
APacket would have a longer header
BPacket would be discarded immediately
CPacket would be allowed to fragment
DPacket would have no data
💡 Hint
Refer to the explanation in key_moments about Flags at Step 6.
Concept Snapshot
IP Packet Structure:
- Starts with a header (min 20 bytes)
- Header includes Version, Length, Flags, Addresses
- Total Length = Header + Data size
- Flags control fragmentation
- Source and Destination IPs identify sender and receiver
- Data follows header as payload
Full Transcript
An IP packet begins with a header containing important fields such as Version, Header Length, Type of Service, Total Length, Identification, Flags, Fragment Offset, Time to Live, Protocol, Header Checksum, Source IP Address, Destination IP Address, and optional fields. The header length tells where the data starts. Flags control fragmentation behavior. The total length field shows the entire packet size including header and data. Source and destination IP addresses specify sender and receiver. After the header, the data payload is carried. This structure allows routers and devices to process and forward packets correctly across networks.