both tcp and udp
That is the way the standard designed the header. They could be placed anywhere as long as everyone understood where in the packet header it was placed.
to enable a receiving host to forward the data to the appropriate application
It is a TCP Header
• checksum • destination port • source port
The port number is random
So the destination host knows what port to send it to. If the destination just takes a guess as to what port to send it to and sends an RDP packet to port 80 what do you think is going to happen?
Yes it sure can and will if the valve covers are leaking oil and the header gaskets are worn out/ leaking.
ephemeral port numbers and well known port numbers
8
Ephemeral port numbers and well-known port numbers.
a tcp header contains the information of the source and destination networks and well as what port to access with out it the packet would not know where to go
An Ethernet frame has a 14 byte header, a data section, and a 4 byte trailer 14 byte header consist of destination address, source address and type The trailer is for CRC (Cyclic redundancy Check) An Ethernet frame can contain an IP and TCP PDU. IP header most important parts consists of (Version,IHL, Total length,Protocol, source and destination address) In details (Version,Header length,Differentiated services field, total Length, Identification, Flags, fragment offset, Time to live, protocol, header checksum, source and destination address). TCP header most important parts consists of (Source port, Destination port and header Length) In details (Source Port, Destination Port, Sequence number, Acknowledgment number, Header length,Flags,Window and check sum). The details of the IP and TCP header have been taken from a Network protocol Analyzer Wireshark on my own pc.