Given only two hosts:
- A hub or unmanaged switch will be mostly invisible.
- A managed switch and a router will have a MAC address on the interface. If it
is an IP network, these devices will appear as a "hop" in a
Traceroute. From the MAC, you can get some information about the manufacturer
I'm not sure what you mean by "gateway." My understanding is that a gateway is just a role for a router to play. In this case, a router is detected like above.
If your managed switches and routers have SNMP available, you can query these devices to find out a plethora of data about the make/model/type of device.
I said "mostly" invisible above because, theoretically, there is a minuscule latency added to the packet traversal. However, given only two hosts, this latency would be next to impossible to detect.
@CanadianLuke Was your question an attempt to get his question closed and removed? Often forums don't like so-called "homework questions". It was an interesting question. – barlop – 2015-04-08T11:36:42.827
2What have you tried? What OS are you using? What information about the network do you have? What have you researched? – Canadian Luke – 2014-06-17T15:19:06.643
1Read the label? – Austin T French – 2014-06-17T15:20:47.660
It was asked to me in my interview. I couldn't answer it, but I think its a nice question to look answer for... No extra information was provided.. – user3749029 – 2014-06-17T15:21:23.580
1can those devices successfully communicate? – wmz – 2014-06-17T15:47:59.717
4Is this a homework question? – Canadian Luke – 2014-06-17T16:13:39.140
Its not an homework question. I am keen to know the answer – user3749029 – 2014-06-17T18:57:56.370
2When its 2014, its not a hub ;) – PlasmaHH – 2014-06-17T20:43:19.970