2

Theoretical question. Can every computer on the Internet be connected directly to router instead through switch?

This can be paraphrased as can we make a network setup where we replace all switches with routers (or NAT routers)?

I'm not sure but maybe this boils down to the why do we need MAC if we have IP asked already here: Why do we need MAC address? and here What is the exact use of a MAC address?.

Most of the answers do not satisfy me, like we need Layer 2 addressing, IP is layer 3..., or inter-operation of two protocols.

Let me explain couple of counterarguments:

  • If end device has a direct link to router it can give him the IP directly, no need to pre-communicate with MACs.

  • MACs are unique and can be blocked, but they can also be faked. I don't see other need for unique addressing.

  • Why map MAC with ports (links) when we can map IP with ports (links).

I'm motivated by our home networks where we don't really need switches instead we connect devices with NAT routers.

So without link layer switching and addressing it would go like this:

  • I connect to router with dedicated link (wireless or ethernet)
  • It gives IP address to that link
  • I continue communication with Internet hidden behind NAT communicating with my router on my dedicated link

Can you say what feature would we miss if we eliminate all the switches?

croraf
  • 155

2 Answers2

3

Can every computer on the Internet be connected directly to router instead through switch?

Yes.

I'm motivated by our home networks where we don't really need switches instead we connect devices with NAT routers.

You are talking about a home router with 4 LAN ports and 1 WAN port? Those 4 LAN ports are on a switch integrated in the home router.

The followup question is: If you can replace all switches by routers, why don't we do that?

Answer: Routers are much more expensive than switches, both in terms of hardware cost and in times of computing ressource needed to do the networking. So it would be wasteful.

And the internet isn't consisting only of home users behind ISPs. No sane computing center would throw out all switches and replaces them with routers, not if they want to keep making money.

dirkt
  • 17,461
2

A router is also a host at layer-2. If the layer1/2 LAN is an IEEE LAN (ethernet, Wi-Fi, token ring, etc.), then it must communicate using a MAC address on the LAN. The IEEE LAN protocols use MAC addresses to communicate. A host directly connected to a router interface via ethernet (or other IEEE LAN) would still communicate by MAC address. If you connect with a different layer-1/2 protocol, e.g. to a serial interface via PPP, then you would not use a MAC address, but you will probably not get close to the speed of modern ethernet.

The point of the network layers is using encapsulation and abstraction. This leads you to being able to transport any layer-3 protocol (IPv4, IPX, IPv6, AppleTalk, etc.) on the layer-2 LAN, even simultaneously. You would not want to have to replace your LAN equipment (e.g. switches or WAPs) when adding or migrating to IPv6.

Ron Maupin
  • 3,463