|
Posted by Intuitive on January 15, 2008, 2:32 am
If you were Registered and logged in, you could reply and use other advanced thread options
Tomás Ó hÉilidhe wrote:
>
> I have broadband internet at home. The WAN port on my router has a
> public address, and all the hosts on my LAN have private addresses. The
> router performs NAT so that we can all access the internet (well over
> TCP and UDP anyway).
>
> Anyway, my router has a built-in HTTP daemon which provides a web
> page for configuring the router. When I go into "LAN statistics", it
> tells me what hosts are on my LAN. It tells me their IP address, their
> MAC address, and their host name.
>
> First thing I'm curious about is how the router knows what's sitting
> on the LAN. My first thought was that maybe it just looks at the DHCP
> leases it has given out, but then I tried configuring one host's IP
> address manually and it still came up in the host list.
Each packet that goes through the Router, contains a source IP address
inside it. Therefore, each time a Computer tries to send data through
your Router; the Router is made aware of that Computer.
>
> Another thought I had was that maybe it just pings all the addresses
> in the network address range. Only problem here though is that my
> address range is 10.0.0.0/8, so it would have to ping about 16 million
> hosts, and I doubt that that's what it's doing.
>
> Another thought I had was that maybe it looks at the MAC address
> table in its internal switch?
>
Quite possibly.
> Does anyone know a home broadband internet router typically
> determines what hosts are on the LAN?
Depends on the company which made the Router. Each company might use
different methods.
>
> My second question pertains to how a computer knows whether there's
> an ethernet cable plugged into the NIC (i.e. how it knows that it's on a
> LAN). For instance, in Windows, I have a little icon in the bottom right
> corner; the icon is two little machines, and it represents my NIC
> network connection. When there's no ethernet cable plugged in, there's
> an X through the icon. When I plug a cable in (e.g. a cross-over between
> two laptops), then all of a sudden the X disappears and it instantly
> knows it's on a LAN. How is this?
The NIC detects the presence of electricity flowing through it. What a
miracle :-)
Next, Windows notifies you (graphically) that the network card is no
longer receiving electricity from a network cable.
Also, after a second or two, it pops
> up a little balloon box saying whether it's 10 or 100 Mbps. Again, how
> does it know this?
Auto-negotiation. It's a feature of network cards which determines the
highest possible speed available, using the speed of both ends of the
cable link.
>
> Last thing I want to ask about is the host name. How does it get the
> hostname (e.g. "family-pc" or "laptop-james")?
Because a NetBIOS name has been set on each of these Computers.
Is there some sort of
> layer 2 or layer 3 protocol for getting a host's name?
Yes, it's called NetBIOS. It stands for Network Basic Input Output
System. Microsoft created it.
Does anyone know
> a way of intercepting the hostname request in Windows?
You can intercept the request by reading it with a type of program
called a Port Sniffer.
If you wish to block these requests, then you can do so by setting up
firewall rules to block NetBIOS traffic. If you use your research skills
here, then you'll be able to find which TCP or UDP ports NetBIOS uses :-)
|