0

Say we have a LAN - 5 hosts connected to a switch. I have not configured any IP address to any of the hosts. Can I communicate with another host machine by sending L2 traffic - L2 header and data above it?

If yes, how any host will know the MAC address of destination host, for ARP we need an IP address anyway.

0

Say we have a LAN - 5 hosts connected to a switch. I have not configured any IP address to any of the hosts. Can I communicate with another host machine by sending L2 traffic - L2 header and data above it?

Yes. Most operating systems will provide APIs for that (though usually privileged), and there exist various programs which implement protocols directly on top of Ethernet. (And that's of course how IP itself is implemented by the OS.)

If you're looking for examples, "etherwake" and "open-plc-utils" are two projects that come to mind.

If yes, how any host will know the MAC address of destination host, for ARP we need an IP address anyway.

It won't magically know the destination. That's something your program/protocol needs to handle by itself. For example, you could simply ask the user to specify the correct destination MAC address by hand.

You could also implement some kind of a discovery protocol that makes use of L2 broadcasts (i.e. make an equivalent of ARP for your own protocol). For example, in Mikrotik RouterOS, the "RoMON" L2-based management protocol will broadcast discovery packets and collect responses from nearby nodes.

(Meanwhile, the "MAC-Telnet" protocol simply broadcasts all data and doesn't care about the next hop MAC address at all. This is of course a security problem, and only acceptable because MAC-Telnet is a last-resort recovery tool.)

Or you could use multicast and make all nodes listen for packets on a fixed address. For example, the Homeplug management protocol (open-plc-utils) will by default send all frames to 00:b0:52:00:00:01 and will get a response from any Homeplug device.

  • Thanks a lot. My doubt is clarified. – Saurabh Suman Jan 1 '20 at 13:34
1

If you only have L2 connectivity (aka ethernet in your case) there is no notion of a host<->mac-address mapping except for what the computer knows about his own hostname and mac-address.
Obviously by monitoring the "Source" mac-address on received packets (either addressed to its own mac-address or broadcast to all) it can learn about other mac-addresses that exist on the LAN (sort of in the same way a switch learns which mac-address is behind which port on the switch).
But in order to known that computer XYZ has mac-address 00112233445566 someone (the user) needs to specify that somewhere.

To query dynamically on the LAN which mac-address goes with a given hostname more work is needed: You could write some piece of software that sends a broadcast L2 packet to the whole LAN and as payload sends a hostname. And you can place a piece of software on all computers that listens for such packets and send a response if it receives that broadcast packet containing its own hostname.
That would more or less replace the functionality of ARP in the IP-world.
Congratulations: You have just created a rudimentary function on top of a L2 network that is the first step to implementing a full L2-L3 network stack.

0

At the data-link layer (Ethernet in this case), there is no concept of an "IP address", the only address that exists is the MAC address. Frames that are sent can be marked as containing IP packets (EtherType 0x0800/0x86DD), but it's up to higher-level layers to decide what to do with the data.

Solely from the point of view of the Ethernet interface, this is possible. However, from the point of view of most devices using the interface, they would prefer to see the network from the TCP/IP or UDP/IP layer and would not see what exists beneath that. One would need specialized network software to make use of these packets for communication.

The Juniper Tech Library article Networking at Layer 2: Benefits of Ethernet Frames says this about the subject:

  1. Most information starts and ends inside Ethernet frames. Today, this applies to data, as well as voice (for example, VoIP) and video (for example, Web cams).
  2. Ethernet frames have all the essentials for networking, such as globally unique source and destination addresses, error control, and so on.
  3. Ethernet frames can carry any kind of packet. Networking at Layer 2 is protocol independent (independent of the Layer 3 protocol). Layer 2 networks work for IP packets and all other Layer 3 protocols.

Managing MAC addresses in a pure L2 network is up to the software that handles the packets. Addresses will need to be broadcast to be known over the network. The Address Resolution Protocol (ARP) is the one communication protocol used for discovering link layer addresses.

  • Hey Harry, what I wanted to understand is how will the Destination MAC address field be filled in the frame originating from say host A to host B. How are MAC address learnt in case IP addresses are not configured and I wanted communication solely on basis of MAC address in my LAN. – Saurabh Suman Jan 1 '20 at 10:21
  • Added above at the end. – harrymc Jan 1 '20 at 10:29

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.