The same exact strip primitive can show shallow packet layers. This constructed frame compares TCP and UDP transport headers without modeling their runtime behavior.

highlighted = computed this step

Why strips can nest

A frame can contain another protocol's bytes as payload. This constructed example keeps the layout shallow: Ethernet, IP, and transport headers only.

transport examples=2\text{transport examples}=2

Transport two ways

This constructed frame is Ethernet → IP → transport, with the transport header shown two ways: TCP, then UDP.

transport forms=2\text{transport forms}=2
Nested packet stripsA constructed frame with Ethernet, IP, and two transport strips (TCP and UDP).Ethernet header112 bits / 14 bytes0xdeadbeef0001deadbeef00020800byte 0byte 1byte 2byte 311011110101011011011111011101111byte 4byte 5byte 6byte 700000000000000011101111010101101byte 8byte 9byte 10byte 1110111110111011110000000000000010byte 12byte 130000100000000000dst-mac0xdeadbeef0001(cont.)(cont.)src-mac0xdeadbeef0002ethertype2048->IPv4IP header160 bits / 20 bytes0x4500003c1c4640004006b1e6ac100a63ac100a0cbyte 0byte 1byte 2byte 301000101000000000000000000111100byte 4byte 5byte 6byte 700011100010001100100000000000000byte 8byte 9byte 10byte 1101000000000001101011000111100110byte 12byte 13byte 14byte 1510101100000100000000101001100011byte 16byte 17byte 18byte 1910101100000100000000101000001100version4ihl5dscp_ecn0x00total_length60identification0x1c46fragment_offset0ttl64protocol6->TCPheader_checksum0xb1e6src172.16.10.99dst172.16.10.12reserved_flag: clear df: set mf: clearTCP header160 bits / 20 bytes0xc000005000000001000000005002ffff00000000byte 0byte 1byte 2byte 311000000000000000000000001010000byte 4byte 5byte 6byte 700000000000000000000000000000001byte 8byte 9byte 10byte 1100000000000000000000000000000000byte 12byte 13byte 14byte 1501010000000000101111111111111111byte 16byte 17byte 18byte 1900000000000000000000000000000000src-port49152dst-port80seq0x00000001ack0x00000000offset-flags0x5002window65535checksum0x0000urgent0UDP header64 bits / 8 bytes0xc000003500140000byte 0byte 1byte 2byte 311000000000000000000000000110101byte 4byte 5byte 6byte 700000000000101000000000000000000src-port49152dst-port53length20checksum0x0000

Ethernet names the payload

Destination MAC 0xdeadbeef0001 and source MAC 0xdeadbeef0002 are followed by ethertype 2048, which maps to IPv4.

2048IPv42048\mapsto \text{IPv4}
Nested packet stripsA constructed frame with Ethernet, IP, and two transport strips (TCP and UDP).Ethernet header112 bits / 14 bytes0xdeadbeef0001deadbeef00020800byte 0byte 1byte 2byte 311011110101011011011111011101111byte 4byte 5byte 6byte 700000000000000011101111010101101byte 8byte 9byte 10byte 1110111110111011110000000000000010byte 12byte 130000100000000000dst-mac0xdeadbeef0001(cont.)(cont.)src-mac0xdeadbeef0002ethertype2048->IPv4IP header160 bits / 20 bytes0x4500003c1c4640004006b1e6ac100a63ac100a0cbyte 0byte 1byte 2byte 301000101000000000000000000111100byte 4byte 5byte 6byte 700011100010001100100000000000000byte 8byte 9byte 10byte 1101000000000001101011000111100110byte 12byte 13byte 14byte 1510101100000100000000101001100011byte 16byte 17byte 18byte 1910101100000100000000101000001100version4ihl5dscp_ecn0x00total_length60identification0x1c46fragment_offset0ttl64protocol6->TCPheader_checksum0xb1e6src172.16.10.99dst172.16.10.12reserved_flag: clear df: set mf: clearTCP header160 bits / 20 bytes0xc000005000000001000000005002ffff00000000byte 0byte 1byte 2byte 311000000000000000000000001010000byte 4byte 5byte 6byte 700000000000000000000000000000001byte 8byte 9byte 10byte 1100000000000000000000000000000000byte 12byte 13byte 14byte 1501010000000000101111111111111111byte 16byte 17byte 18byte 1900000000000000000000000000000000src-port49152dst-port80seq0x00000001ack0x00000000offset-flags0x5002window65535checksum0x0000urgent0UDP header64 bits / 8 bytes0xc000003500140000byte 0byte 1byte 2byte 311000000000000000000000000110101byte 4byte 5byte 6byte 700000000000101000000000000000000src-port49152dst-port53length20checksum0x0000

TCP is another strip

The TCP header is 20 bytes: its source port is 49152, the destination port is 80, the window is 65535, and the offset-flags word is 0x5002.

4915280,0x500249152\to80,\quad0x5002
Nested packet stripsA constructed frame with Ethernet, IP, and two transport strips (TCP and UDP).Ethernet header112 bits / 14 bytes0xdeadbeef0001deadbeef00020800byte 0byte 1byte 2byte 311011110101011011011111011101111byte 4byte 5byte 6byte 700000000000000011101111010101101byte 8byte 9byte 10byte 1110111110111011110000000000000010byte 12byte 130000100000000000dst-mac0xdeadbeef0001(cont.)(cont.)src-mac0xdeadbeef0002ethertype2048->IPv4IP header160 bits / 20 bytes0x4500003c1c4640004006b1e6ac100a63ac100a0cbyte 0byte 1byte 2byte 301000101000000000000000000111100byte 4byte 5byte 6byte 700011100010001100100000000000000byte 8byte 9byte 10byte 1101000000000001101011000111100110byte 12byte 13byte 14byte 1510101100000100000000101001100011byte 16byte 17byte 18byte 1910101100000100000000101000001100version4ihl5dscp_ecn0x00total_length60identification0x1c46fragment_offset0ttl64protocol6->TCPheader_checksum0xb1e6src172.16.10.99dst172.16.10.12reserved_flag: clear df: set mf: clearTCP header160 bits / 20 bytes0xc000005000000001000000005002ffff00000000byte 0byte 1byte 2byte 311000000000000000000000001010000byte 4byte 5byte 6byte 700000000000000000000000000000001byte 8byte 9byte 10byte 1100000000000000000000000000000000byte 12byte 13byte 14byte 1501010000000000101111111111111111byte 16byte 17byte 18byte 1900000000000000000000000000000000src-port49152dst-port80seq0x00000001ack0x00000000offset-flags0x5002window65535checksum0x0000urgent0UDP header64 bits / 8 bytes0xc000003500140000byte 0byte 1byte 2byte 311000000000000000000000000110101byte 4byte 5byte 6byte 700000000000101000000000000000000src-port49152dst-port53length20checksum0x0000

UDP is shorter

The second transport strip is UDP: 8 bytes with source port 49152, destination port 53, length 20, and checksum 0x0000. A UDP checksum of 0x0000 means none is present, legal in IPv4; UDP checksum and port semantics are deferred.

4915253,2049152\to53,\quad20
Nested packet stripsA constructed frame with Ethernet, IP, and two transport strips (TCP and UDP).Ethernet header112 bits / 14 bytes0xdeadbeef0001deadbeef00020800byte 0byte 1byte 2byte 311011110101011011011111011101111byte 4byte 5byte 6byte 700000000000000011101111010101101byte 8byte 9byte 10byte 1110111110111011110000000000000010byte 12byte 130000100000000000dst-mac0xdeadbeef0001(cont.)(cont.)src-mac0xdeadbeef0002ethertype2048->IPv4IP header160 bits / 20 bytes0x4500003c1c4640004006b1e6ac100a63ac100a0cbyte 0byte 1byte 2byte 301000101000000000000000000111100byte 4byte 5byte 6byte 700011100010001100100000000000000byte 8byte 9byte 10byte 1101000000000001101011000111100110byte 12byte 13byte 14byte 1510101100000100000000101001100011byte 16byte 17byte 18byte 1910101100000100000000101000001100version4ihl5dscp_ecn0x00total_length60identification0x1c46fragment_offset0ttl64protocol6->TCPheader_checksum0xb1e6src172.16.10.99dst172.16.10.12reserved_flag: clear df: set mf: clearTCP header160 bits / 20 bytes0xc000005000000001000000005002ffff00000000byte 0byte 1byte 2byte 311000000000000000000000001010000byte 4byte 5byte 6byte 700000000000000000000000000000001byte 8byte 9byte 10byte 1100000000000000000000000000000000byte 12byte 13byte 14byte 1501010000000000101111111111111111byte 16byte 17byte 18byte 1900000000000000000000000000000000src-port49152dst-port80seq0x00000001ack0x00000000offset-flags0x5002window65535checksum0x0000urgent0UDP header64 bits / 8 bytes0xc000003500140000byte 0byte 1byte 2byte 311000000000000000000000000110101byte 4byte 5byte 6byte 700000000000101000000000000000000src-port49152dst-port53length20checksum0x0000

Summary

This is a CONSTRUCTED frame that carries our real IP header, shown shallow. TCP and UDP checksum and port semantics are deferred; no timing is modeled. Byte layout only; timing/throughput is not modeled here. Timing/throughput is not modeled here — only the exact byte layout.

tcp checksum=0x0000,urgent=0\text{tcp checksum}=0x0000,\quad\text{urgent}=0
Nested packet stripsA constructed frame with Ethernet, IP, and two transport strips (TCP and UDP).Ethernet header112 bits / 14 bytes0xdeadbeef0001deadbeef00020800byte 0byte 1byte 2byte 311011110101011011011111011101111byte 4byte 5byte 6byte 700000000000000011101111010101101byte 8byte 9byte 10byte 1110111110111011110000000000000010byte 12byte 130000100000000000dst-mac0xdeadbeef0001(cont.)(cont.)src-mac0xdeadbeef0002ethertype2048->IPv4IP header160 bits / 20 bytes0x4500003c1c4640004006b1e6ac100a63ac100a0cbyte 0byte 1byte 2byte 301000101000000000000000000111100byte 4byte 5byte 6byte 700011100010001100100000000000000byte 8byte 9byte 10byte 1101000000000001101011000111100110byte 12byte 13byte 14byte 1510101100000100000000101001100011byte 16byte 17byte 18byte 1910101100000100000000101000001100version4ihl5dscp_ecn0x00total_length60identification0x1c46fragment_offset0ttl64protocol6->TCPheader_checksum0xb1e6src172.16.10.99dst172.16.10.12reserved_flag: clear df: set mf: clearTCP header160 bits / 20 bytes0xc000005000000001000000005002ffff00000000byte 0byte 1byte 2byte 311000000000000000000000001010000byte 4byte 5byte 6byte 700000000000000000000000000000001byte 8byte 9byte 10byte 1100000000000000000000000000000000byte 12byte 13byte 14byte 1501010000000000101111111111111111byte 16byte 17byte 18byte 1900000000000000000000000000000000src-port49152dst-port80seq0x00000001ack0x00000000offset-flags0x5002window65535checksum0x0000urgent0UDP header64 bits / 8 bytes0xc000003500140000byte 0byte 1byte 2byte 311000000000000000000000000110101byte 4byte 5byte 6byte 700000000000101000000000000000000src-port49152dst-port53length20checksum0x0000