I have been wondering this for a few days. I basically understand how networks and packets work. But what happends when an unexpected packet arrives? Like, when I didn't send a request for a website's index, but it sends the index to my machine anyways ? Does my browser pop up? Does it ignore it? Anyway to actually catch it?
closed as not a real question by Yusubov, Dynamic, gnat, Martijn Pieters, Walter Jan 26 '13 at 22:55
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.
Simple : It gets thrown away.
If either TCP, or network layer can't accept the packet, then it is thrown away. This might happen if port is not open or packet was re-send, but original packet arrived, so it is not necessary anymore.
TCP and most network system contains rigorous checks on what packets to accept and what packet are bad or corrupted in some way. If such packet arives, it is ignored and client requests a re-send.