0

I've two devices: My-PC and Another-PC.

The two devices are connected to a switch, which is connected to main switch with-in the same LAN.

My question is: how do I get all the device information such as (IP address, MAC address, Serial Number) from My-PC to Another-PC?

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Nov 20, 2022 at 0:20

2 Answers 2

0

The destination gets the layer-2 (e.g. MAC), layer-3 (e.g. IP), and layer-4 (e.g. TCP) addresses from the source when something is sent from one to the other. Other information, e.g. serial number, has nothing to do with the network, is OS specific (off-topic), and it would need to be handled by a protocol above OSI layer-4 (off-topic).

The frame sent from one to the other has both the source and destination MAC addresses (assuming it is a layer-2 protocol that uses MAC addresses, e.g. ethernet) in the frame header. This only works if both the source and destination are on the same layer-2 LAN.

An IP packet in that frame will have both the source and destination IP addresses in the packet header.

A TCP segment or UDP datagram will contain both the source and destination addresses (ports) in its header.

The addressing will be part of what is sent, but other information, e.g. the serial number, will be OS specific (off-topic) and require an application (off-topic) or protocols above OSI layer-4 (off-topic).

2
  • Thanks for your answer ,, but i need MAC address and IP address for the switches which the packet send from source to destination throw it,,, is this information stored in packet ???
    – BlackRoot
    Jul 20, 2017 at 8:03
  • Switches are transparent devices, and they do not alter the original frames. In fact, unmanaged switches do not have IP or MAC addresses. Managed switches do, but that is only for the management of the switch, which is a host on the LAN, and plays no part in the actual switching of the frames on the LAN.
    – Ron Maupin
    Jul 20, 2017 at 13:04
0

This is the information you can extract from devices connected by a switch in a simple way:

  • IP address: just ping all possible, local IP addresses and look at the local ARP cache right after each attempt you'll find an entry for any IP address present (the ARP lookup also turns up devices not honoring ICMP echo requests)
  • MAC address: see above - the MAC address will be in the ARP cache, associated with the IP address
  • the first three octets (bytes) of the MAC address reveal the vendor of the device (or the NIC)

Additionally, you could e.g. examine LLDP packets or STP BPDUs to find out more about the infrastructure but you don't seem to be looking for that.

Your Answer

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

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