Suppose in application layer is running some application. And application has respective source port number and destination port number. And know that
n layer has no authentication to know about
n+1 level payload.
But we see in TCP or UDP header has source and destination application port number. Ipv4 header protocol field has transport layer protocol number and in Ipv6 extension header. Similarly, Ethernet header has Ethertype field has layer3 protocol information.
My question is how layer
n come to know which port/protocol running at
n+1 level despite without knowing
n+1 level payload?