Security · 58 tools · nothing uploads

IPv4 / TCP / UDP header parser

Decode an IPv4 header, then its TCP or UDP header if the protocol field says so (checksum verified against the standard Internet checksum, not TCP/UDP's, which need a pseudo-header this tool is not given the source context to build). Give it bytes starting at the IP header, e.g. an Ethernet frame's payload.

Input

IPv4 / TCP / UDP header parser decodes raw bytes from the front of an IPv4 header, printing IHL, total length, fragment flags, TTL, protocol and both addresses. The RFC 1071 header checksum reads valid or INVALID, then TCP ports, sequence numbers and flags follow, or UDP ports and length. A version field other than 4 stops it.

Questions

What do I feed it?

Raw bytes starting at the IPv4 header, for example the payload of an Ethernet frame. Not a pcap file, and not a hex dump as text. If what you have is a hex dump, convert it to bytes with the From hexdump tool first, then drop the result here.

What does it decode?

Version, IHL and header length, DSCP and ECN, total length, identification, the DF and MF flags, fragment offset, TTL, protocol number with a name for the common ones, and both addresses. When the protocol is TCP it adds ports, sequence and acknowledgement numbers, data offset, the eight flag bits and the window. When it is UDP it adds ports and length.

Does it verify the checksum?

The IPv4 header checksum, yes, using the standard Internet checksum from RFC 1071, reported as valid or INVALID. TCP and UDP checksums are not verified, because those cover a pseudo-header built from context this tool is not given. So an INVALID line points at the IP header itself, not at the payload.

Why did it refuse my bytes?

Three checks can fail. Fewer than 20 bytes gives a message naming the minimum and how many you gave. A version field that is not 4 is refused, with a note that IPv6 headers are not handled. And an IHL that claims a header longer than the bytes available is refused with both numbers.

Can it read a pcap capture?

No. It parses one header at a time from raw bytes, and a pcap file begins with its own global and per packet headers, which would be read as an IP header and rejected. Export the packet bytes from your capture tool, starting at the IP header, and drop those instead.

Related Security tools

·→1Subnet / CIDR calculatorCompute network address, broadcast/last address and host count for an IPv4 or IPv6 CIDR block. Pure arithmetic on the address you give it. No lookup, no network.Takes no file·→1IP range parserParse an IPv4/IPv6 range ("start-end" or CIDR) into its address count and the minimal set of CIDR blocks that cover it exactly. Pure arithmetic, no lookup.Takes no file·→1IPv4/IPv6 format convertShow one IP address in every common representation (dotted/expanded, integer, and hex), computed locally.Takes no file·→1IPv6 transition addressesBuild IPv4-mapped/6to4/NAT64 IPv6 forms from an IPv4 address, or decode an IPv6 address back to its embedded IPv4 (and, for Teredo, server/client/port/flags). Reports what pattern was recognised, not whether the address is reachable or in use.Takes no filen→nEthernet frame parserDecode an Ethernet II frame: destination/source MAC, EtherType (unwrapping one 802.1Q VLAN tag if present), and payload length. IEEE 802.3 LLC/SNAP framing is not handled, only Ethernet II.Runs on each file you dropn→nTLS record parserDecode a raw TLS record (RFC 8446 §5.1): content type, version, length, and for a ClientHello/ServerHello, the cipher suites/extensions inside. Give it bytes captured off the wire, not a PEM.Runs on each file you drop·→1MAC address formatterReformat a MAC address between colon, dash, Cisco dot-quad and bare-hex notation, and report the multicast/locally-administered bits.Takes no file·→1MAC / OUI vendor lookupLook up a MAC address's OUI against a small bundled table of 16 well-known prefixes, not the IEEE registry (2.9M+ entries, updated continuously, no offline way to bundle it here). "Not in bundled list" means exactly that, not "no vendor exists."Takes no file