Ethernet is below IP in the OSI model. But how is an IP address actually assigned to an Ethernet port?

I know, that Ethernet has nothing to do with IP, but under Windows I can assign an IP address to an Ethernet Adapter...

When my card has two ports, what does it mean in terms of IP adresses assigned to them? Do they share the same and I have consider the two ports like a simple hub providing two physical connectors to the same logical thing?

2 Answers 2


I think you need to understand a little more about the network layers and how a device implements a network stack. This question is almost off-topic as it is really particular to the OS running on the device, but I will try to give you a general idea.

In a device, you will have a physical interface at layer-1, and your ethernet card with two interfaces has two separate physical interfaces. The card will have a driver that installs in the OS, and the driver will have the layer-2 (ethernet) software for each interface as separate interfaces.

The OS usually implements the layer-3 (IPv4, IPX, IPv6, AppleTalk, etc.) and layer-4 (TCP, UDP, etc.) software. The layer-3 software registers with the layer-2 software so that the layer-2 software knows where to send traffic up to layer-3. An ethernet frame header has an EtherType field that tells the layer-2 to which registered layer-3 module the frame payload should be sent, e.g. 0x800 is for IPv4, and 0x86DD is for IPv6. IANA maintains the IEEE 802 Numbers for the various EtherTypes.

The layer-3 module registered with the layer-2 module for an interface will be assigned the layer-3 address for that interface.

The same type of thing happens for layer-3 and layer-4. For example, IPv4 has the Protocol field in the IPv4 header (IPv6 has a Next Header field that is the same thing). Again, IANA maintains a list, Protocol Numbers, that tells IP to which registered layer-4 module it should send the packet payload.

  • Good answer. When you say "Interface" on layer-1, does it correspond to a particular RJ45 connector? So each of the two RJ45 connectors can be registered to a particular IP address of layer 3 ?
    – MichaelW
    Jun 27, 2017 at 16:00
  • I would refrain from using the term "port". In this case it is somewhat obvious, but in networking, a port usually refers to a TCP or UDP address. The term "interface" in networking means the physical interface or port, although in software development, interface has a different meaning. It is really the context in which you are using the terms to which you should pay attention.
    – Ron Maupin
    Jun 27, 2017 at 16:03
  • @michael, conceptually, although the actual implementation varies by OS, each physical interface will have its own layer-2 module, even if the interfaces are on the same physical card, and each layer-2 module will have separate, registered, layer-3 modules, which each have separate, registered, layer-4 modules. In practice (this depends on the OS and you may not know much about programming, so it may be confusing, in which case, just ignore it), there is probably only one module for each layer, but there are separate instantiations for each interface.
    – Ron Maupin
    Jun 27, 2017 at 16:13

Each interface on your NIC should be assigned a different IP address or there will be an addressing conflict. You can either receive an IP address via DHCP or set one manually as you see through your GUI.

Each interface also has its own MAC address for layer 2 communication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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