# Do networking ports come from “port-mapped I/O”?

Do networking ports come from "port-mapped I/O"?

I was watching a hardware basic video by Brian Will:

And they brought up this concept at 18:15

Initially, I thought it makes sense that networking ports come from the implementation of port-mapped I/O, but it's strange that the video uses the term "devices" instead of "applications" when referring to doing I/O tasks with ports.

• I'm not sure how on-topic this question is here, but the answer is "no". While "port" here is being used in the same non-technical sense for "port-mapped I/O" and "network ports", they have literally no technical connection. In port-mapped I/O, the "ports" are accessed with special CPU instructions which allow communication to hardware devices. Network "ports" are just pieces of data in TCP or UDP packets to allow multiplexing connections to a single IP address. – Derek Elkins left SE Mar 26 '17 at 0:22
• @DerekElkins That actually answers my question perfectly. I can see how this starts to connect with the implementation of TCP in the OS. A OS application would parse the TCP packets to get the port number, and then the OS would route the data packets to the application that is listening on that port, or something along those lines. Thanks for your help. – Artur Mar 26 '17 at 2:07
• @DerekElkins, would you like to write that as an answer, so we can upvote it and so the question will be treated as answered? – D.W. Mar 26 '17 at 22:32

In port-mapped I/O, the "ports" are accessed with special CPU instructions (in, out in the x86 family) which communicate with hardware devices. For x86, at least, due to the limited "address space" of port-mapped IO (and other reasons), memory-mapped IO or direct memory access are used for bulk data movement. There's nothing magical about port-mapped I/O. Modern ARM processors, for example, don't have it at all and instead rely entirely on memory-mapped I/O.