This analogy may go over your head if you're not familiar with amateur radio, but let's try anyways. ;-)
Think of a port like listening to amateur radio (ham radio) on a specific frequency. There may be thousands of amateur radio operators on the air trying to make contacts, but maybe only a handful, or one, or none on the frequency you are listening to. You might hear an amateur radio operator calling from the US, from Japan, or from anywhere else, or you might not hear anyone. BUT, you won't hear the Canadian operator calling on a different frequency (port) at all. And the frequency that you're listening on won't have anything to do with what the calling operator has to say (i.e., what type of file or request comes in on that port.)
Having said that though, there are certain ports that have become standardized for certain uses. From a technical point of view, there's nothing special about a particular port, it's just that the world has agreed to use certain ports for certain purposes as an accepted standard. It doesn't mean that you can't use a certain port for anything else, but it probably isn't a great idea.
In exercise 4, the headers are the first part or parts of the file. They will contain information about the file type and structure, and will usually start with a signature that tells what type of file it is. It doesn't matter how they are read, the signature defines the file type.
Hopefully, this helps.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)