0

This question in its current state may be too broad, so I'll clarify.

Obviously, most routers today are a combination modem, WiFi transceiver and router, taking the signal off the phone line, converting it, and then sending it either over copper, F/O, or 802.11.

But what does the router actually do when it "routes"? From studying the TCP/IP stack, it's clear that source/destination addresses and ports occur in a few different points of the stack, so it at least seems like the endpoint devices should be able to do their own discrimination, simply ignoring packets not intended for them. To add to the confusion, this seems like the primary system 10BASE-2 relied upon, every device in the link being patched over the same connection.

So, what is the router doing with the data when it comes in (assuming the WiFi and modem stuff is taken out of consideration)?

  • 1
    Hubs simply retransmitted all messages on all ports to all ports and relied on the end point devices ignoring messages they did not care about. A router adds some intelligence and does not retransmit data on a port where it knows no device cares. This potentially increases the data throughput as ports don't carry as many unwanted messages. – Warren Hill Jul 05 '15 at 10:34
  • 1
    Consider that there are too many endpoints for IPv4 to address them all ... that's a lot of traffic to reach every endpoint just to be ignored. Any time a router decides not to forward a packet, it is playing a part in reducing that traffic to manageable volumes. – user_1818839 Jul 05 '15 at 10:37
  • 4
    This isn't the site for TCP/IP questions like this; have requested transfer to superuser.SE –  Jul 05 '15 at 11:29
  • @WarrenHill So, if I understand correctly, a router is simply an "intelligent" hub that carries some understanding of the identity of the downstream devices. Is that on the right track? –  Jul 05 '15 at 12:01
  • 1
    A router, as the name suggests, makes decisions about where to send packets based on their target address. In your home network this probably isn't important. In the Internet as a whole it's critical: if every packet was sent to every end point device your laptop would be overwhelmed by the billions of packets it had to examine and then ignore. Imagine if all the mail in the country simply got dumped into a pile in a central warehouse and you had to go there and look for your mail... –  Jul 05 '15 at 12:19
  • @ecfedele basically yes. – Warren Hill Jul 05 '15 at 12:41
  • @WarrenHill not quite. You've lost a middle part: a switch. The switch is an "intelligent hub". And router is a further complication over a switch, basically a small server, which manages network in an even more intelligent way, including doing NAT etc. – Ruslan Jul 05 '15 at 17:07
  • 1
    Your home router is essentially a box hosting some essential services: (1) a gateway between your LAN and the WAN, (2) NAT, (2) DHCP, (3) a firewall, (4) sometimes DNS (all in addition to the modem, WAP and switch functions). – sawdust Jul 05 '15 at 23:02

1 Answers1

2

Your "home router" doesn't really serve the same purpose as say a core router. Pre wifi when broadband started to proliferate in the US you used to have to pay extra for multiple ip addresses, so more per month for multiple computers in the same house. So the first NAT routers were born they took the traffic from multiple computers on your internal private home network and sent it out the single ip you paid for in the public network. Literally taking each tcp or udp request and rewriting it as if it came from your public ip.

In the reverse direction the router would receive replies and route them back to the correct host on your home network. There was some resistance on the part of the ISPs but eventually they were everywhere.

Now over time they've become more advanced as companies competed in the market place and new technology arrived. Early on firewall was added as a security feature to "protect you from evil hackers". Later things like wifi, maybe VPN, print server, routing priority and other capabilities were added.

Still I think the primary purpose of the home router remains to connect multiple private networks devices through one single device. This works against some direct connect services like VoIP, video or filesharing. So most routers also have route tables that allow you to forward ports to certain computers or try to open the firewall for others. Incidentally since most users couldn't handle adding the above configuration this spawned a whole bunch of software techniques for nat traversal, basically ways for another computer or site to open a connection to a machine in your network by keeping ports open.

  • Good answer, talking about home router, which is what the question seems to be about, rather than the more general router. –  Jul 05 '15 at 14:15