0

What is the hardware implementation of a port and/or network socket?

I understand that, at the lowest level, x86 uses opcodes such as IN and OUT when the data resulting from the instruction execution is to be sent to a peripheral with a port-mapped I/O memory address. Am I making an incorrect assumption that the port-mapped I/O memory addresses are synonymous with ports identified for networking? Whenever I read about the use of ports, the application has been abstracted far past the physical layer and it is difficult to draw a connection between the host hardware and their use in networking.

1

There is no hardware implementation of a TCP or UDP port or a network socket. That is like asking for a hardware implementation of an IP address. Ports are layer-4 addresses, and they are conceptual. A port represents a software connection between a layer-4 protocol and an application. A network socket consists of a combination of source and destination layer-3 (e.g. IP) and layer-4 (e.g. TCP) addresses.

| improve this answer | |
2

All modern interfaces use DMA transfers. The IN/OUT opcodes are ancient, mostly used in the 16-bit era. Those hardware registers aka I/O ports have nothing to do with network ports as in hardware interfaces (ie. where you plug a cable into).

You might also be referring to TCP or UDP ports which are yet something different. These are subaddresses of a host that services are bound to (like TCP 80 for a HTTP web server or TCP 25 for an STMP mail server).

| improve this answer | |
  • Good to know about the DMA. I was aware of that but reading more about it gives me a much better understanding of what's going on. Thanks! – Michael Kennedy Jul 16 '17 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.