In the Internet Protocol version 4 (IPv4) [RFC 791] there is a field called "Protocol" to identify the next level (L4) protocol. This is an 8 bit field. In Internet Protocol version 6 (IPv6) [RFC 8200], this field is called the "Next Header" field.

e.g. TCP is 6, UDP is 17.

Reference