Monday, March 2, 2020

why is a router necessary


IP routing is necessary because pure Ethernet level switching does not scale well.

Ethernet device addresses are assigned by the manufacturer - there is no useful structure in them; They are random, as far as the network refers. So an Ethernet switch has only two options: keep a list of all devices connected to each port (as modern switches do), or simply broadcast all packets to all ports (as in the original Ethernet) .

Both methods work well only up to a certain size of the network , but if there are more devices that a switch can remember, the network will quickly melt down. (Related topics: CAM exhaustion)

Therefore, similar to zipcodes or telephone numbering, IP gives the network a structure - each network, sub-network, super-network is assigned an address block, and can describe routes, such as "The addresses starting with [10.7.xx] can be reached through [port 3]" Now the rest of the world doesn't need to know about millions of Comcast customers, it only takes a couple of routes to Comcast itself. Routers managed router service
IP maintains knowledge of these routes, and henceforth all packets accordingly.

(This separation between Ethernet and IP is really useful because it gives flexibility - the same Ethernet can carry different protocols, IPv4, IPv6, maybe IPX ... Some other protocols do not have that separation, such as DECnet or NetBIOS, and it could not survive the growth of the network.)
It is possible to go to: Modem -> switch -> Computers with static IP addresses
Sure, technically it is possible. Static ip addresses are not even necessary.

In fact, in an ISP next to my workplace, about 20 business clients around the city don't really have their own routers - their 'external' switches are connected directly to an ISP router in the building (which even serves dhcp for all of them), as described.

But there are reasons why it is not usually done this way. (It must be admitted that some of them come from the shortage of IPv4 addresses - such as NAT. But many still be important even in a pure world of IPv6.)
As it is now , the ISP routes a single "global" IP address to its network. So, certainly, you can connect the PC directly to the modem and configure it with your "global" address. (The possibilities are, that you even autoconfigure that through dhcp.)

In fact, this used to be very common in the configuration from here until the end of the 2000s. The majority of customers had only one device, and that device often Speak directly through the modem of the ISP routers - the first use of a dial-up modem, after an ADSL.

But each device has its own address. Since you only have one IPv4 address of your ISP, you can directly connect a computer, but not two- unless you pay extra for the second address.

That's why your home router has a "network address translation" (also known as NAT), which gives you a block of "private" 192.168.x addresses and hides behind a single "global" one.

(CGNAT is also noteworthy, but the research is left to the reader.)
Next to NAT, your "router" also has other functions such as a firewall, dhcp server, DNS cache. Yes, those that all could be done by the ISP, routers, but that would cost the ISP a bit fair and that would cause inconvenience to all customers, without giving advantages to any of them.

The firewall would have to be configured through its ISP interface, and most Isp would only provide the minimum of options. (When configuring my own router I have full control - I can apply the firewall rules for infrequent protocols; I can create several subnets; I can experiment with IPv6 or RIP or OSPF tunnels ...)

Both the firewall and NAT need resources for connection tracking - a certain amount of memory, some CPU power. Currently these resources are distributed, since the router just has to follow its own connections. But if everything was done by the access provider, their routers would have as much to the memory and CPU as all the clients of 'routers together , which is expensive.

The dhcp server works much better when it is on your side. Even if the Internet cable is cut, its own devices can still obtain IP addresses and local communication. (Yes, yes, static addresses are possible, but believe me, they are a pain in the ass to keep track of.)

The DNS cache worksBecause it is at home. The ISP has its own DNS cache any way , but the router still has its own small cache, simply because it is closer to you, serves fewer devices, and therefore can respond much faster. (Slow DNS is very noticeable.)
So the reasons for having your own home router are, 1) it is faster, 2) it is cheaper, 3) it is easier for you and for the ISP.




1 comment:

  1. Do this hack to drop 2lb of fat in 8 hours

    More than 160 000 men and women are using a easy and SECRET "liquid hack" to lose 1-2 lbs each night as they sleep.

    It is effective and it works all the time.

    This is how to do it yourself:

    1) Get a drinking glass and fill it with water half glass

    2) And then follow this awesome hack

    and you'll be 1-2 lbs lighter in the morning!

    ReplyDelete