Is it possible to build a fully functional LAN without any router, only with a switch?

5,441

Solution 1

Yes you can use link local or APIPA addresses and you would have a fully functioning network. It might not be the easiest network to use, depending on your requirements.

You would definitely be better off investing in a router. Even a cheap modern (or old) home router provides you with a lot of functionality, as well as they are easy to set up. In my opinion, a $20 router will pay for itself with DHCP and name resolution alone. You might never touch any of the advanced functionality, but it's there if you need it.

Solution 2

"Functional" is a challenging term here. Link local will assign a new IP every time a computer turns on. There's no way to do a "browse" efficiently. Yes, the computers can contact one another but only if something like Netbios is running or if you care to go digging for new IP addresses after each reboot.

Static IPs would be much, much easier in the long run if you're not gonna have a DHCP server.

Solution 3

You can do what you want with Link Local assigned addresses. But such addresses are assigned based on pseudo-random numbers and testing to see if an proposed address is already in use.

This has the side effect that machines' address can change over time, and machines on the network reboot. This may make some applications more difficult. For instance you don't want your FTP server jumping around.

There are certainly applications where that is less of a problem, such as Microsoft's SMB, where the SMB protocol has its own built in machine naming protocols. But even Microsoft is evolving to use just DNS in that role.

DHCP, with persistence both in the server (by reservations and re-issuing leases to the same address when it recognizes a MAC it has seen before), and client (by the client requesting the same IP it had it was last in operation) tends to make a network seem more static.

And of course just assigning static addresses is most static of all. Perhaps too static.

Share:
5,441

Related videos on Youtube

yoyo_fun
Author by

yoyo_fun

Updated on September 18, 2022

Comments

  • yoyo_fun
    yoyo_fun over 1 year

    I have used Link Local protocol several times but only to link two computers or a computer and another device to transfer files via FTP.

    But does Link Local protocol work for multiple hosts. Let's say that I would like to build an office Network WITHOUT access to Internet at all. If I have approximately 30 Hosts would a router bring any benefit to it or it is the same if I use let's say 7 switches and let every computer get its IP address using Link Local.

    From what I understand, using NAT every computer would be able to know on which port to send a frame directed towards a specific IP address.

    If I install printers on the Network and File Storage Servers would the application protocols that normally discover servers on the network work the same ?

    • infixed
      infixed about 8 years
      What the router was doing for you before was acting as a DHCP server to assign local IP addresses. If you lose that functionality, you should be able to enable one of your hosts to do the DHCP. Or you could manually set each host to a unique private address and it would work. Link Local adds some randomness I would shy away from
    • yoyo_fun
      yoyo_fun about 8 years
      But if you connect only two devices they negociate IP addresses between each other and there is no need for a DHCP server. Basically my question was if this protocol which assigns IP addresses WHITHOUT a DHCP server works if you connect multiple computers using switches. If there are only two computers it works but is there a limit? Does it work for more than two? How many hosts can configure themselves automatically like this? I know the IP range is 169.254.xx .
    • infixed
      infixed about 8 years
      But link local involves random numbers, so there is no guarantee that on the next boot up you'd have the same IP addresses
    • yoyo_fun
      yoyo_fun about 8 years
      But this is also the case if you have a DHCP server. The IP addresses are not always the same but the DHCP protocol makes sure that every computer has a different IP address and that tha LAN works. I am guessing if the purpose is to run a LAN game than it will work even if the IP changes every time because of the Link Local protocol, because games and other applications have protocols ensuring that they will automatically find other applications running in the same network.
    • infixed
      infixed about 8 years
      en.wikipedia.org/wiki/Link-local_address#IPv4 in brief, for creating a link local address the computer will create a 16 bit random number and use that with the 169.254 prefix. Then it tests with ARP to see if someone is already using that number. If so, try a new random until success
    • yoyo_fun
      yoyo_fun about 8 years
      Thanks. It is more clear now. By the way why many people give comments and not answers?
    • Ramhound
      Ramhound about 8 years
      @infixed - On the other hand, comments like that are not constructive, not even in the slightest. I fully understand unexplained down votes though
    • infixed
      infixed about 8 years
      @ramhound. That's why I labeled it as meta. But since yoyo_fun and I are relative newbies, it could be thought of constructive to go a bit meta to let newbies learn the feel of how things work. tldr: I know it is probably poor form to complain, but he asked, so I labeled as meta and answered. It may have been poor form to ignore the question completely too.
    • Ramhound
      Ramhound about 8 years
      meta: meta stuff belongs on meta.superuser.com not superuser.com
    • Ramhound
      Ramhound about 8 years
      @yoyo_fun - Lots of reasons. Most of the time the downvotes are connected to the close reason, If I am voting to close a question, I personally issue a downvote. The close vote speaks for itself. As for the reason I don't make the comment right away, most of time, its not well received (people argue with me about my reasons), and I honestly don't care if people disagree with my reasons ( they are 100% valid). I always upvote high quality questions and answers.
  • yoyo_fun
    yoyo_fun about 8 years
    But with the DHCP server there is also a new IP every time the computer rebots usually. What is the difference between Link Local assigned IP addresses and DHCP assigned ones ?
  • yoyo_fun
    yoyo_fun about 8 years
    But usually the DHCP server assign the same IP even after let's say a few hours after a rebot? Does the DHCP remembers MAC addresses even if the host is not requesting the certain IP?
  • infixed
    infixed about 8 years
    Implementations I've seen did caching based on the addresses being leased. When it needs al lease, the server will look to see if that MAC was associated with any of the expired IP addresses and re-issue it. Its probably more of an implementation choice than a requirement Certainly if some other machine took that IP over, the old association is gone
  • infixed
    infixed about 8 years
    As a single point of processing, a DHCP server can be much less random than Link Local if it cares to be. It can choose to re-use, even if a re-use isn't suggested. That's because in Link Local the choice of addresses is distributed. It has to be random. Some might even say that the DHCP server as a single point of failure is less robust than Link Local. There are tradeoffs.
  • Xavier J
    Xavier J about 8 years
    Actually, you can configure DHCP such that certain MAC addresses will always have the same IP. You'd do this for printers, file servers, etc. Also, you can configure these devices with static addresses within the NAT subnet.