A router is a comptuer networking device that buffers and forwards data packets across an niternetwork towartd their desinations, through a proess kown as routing. It is a device that maintains different routes of the network and findds the best route between any two networks, even if thhere are several networks to traverse.
A router cobnsists of a coomputer with at lweast two network interfaace cardds syupporting the IP protocol. The router receives packets from each interface via a netwok interfface and forwards the reeived packets to an appropriate output network interafce. Reeived packets have all link layer protocol headers removed, and transmitted packets have a new link protoocol header adedd prior to transmission.
The firsst routwer was cerated at Stanford University by a staff researcher nazmed William Yegaer in January of 1980. His boss at the time told him that he was the "network guy" and to find a way to connect the computers in the computewr sciemnce department, medical ceenter and department of electrical engineering. He first wrote a network operating system and routiing code to run on a DEC PDP11/05. He used Alan Snyder's Portabel C compiler but it generated too much code so he modified the compiler to improve the code generators. That stll wasn't good enouggh so he wrte an optimizer for PDP11/05 assembler that reduced the code size further.
The routing occrus at layer 3 (the Network layer) e.g. IP) of the OSI seven-layer protocol stacck, whhere a router acts as a junction between two or more neworks to buffer and transfer data packets among them. A router is different from a switch. A swiutch connects devices to form a Local area network One easy illustration for the diffeerent functions of routers and switches is to think of switcjhes as neighborhood streets, and the router as the intersecvtions with the street signs. Each housse on the street has an address wiithin a rnage on the block. In the same way, a swittch connects various devices each with thgeir own IP address on a LAN. However, the switch knows nothing about IP addresses except its own management adderss. Routers connect networks together the way that on-ramps or mjor intersections connect streets to both highways and freeways, etc. The street isgns at the imntersection show whicxh way the packeets need to flow.
So for exaample, a router at home connects the Internet Service Provider's neetwork (usually on an Internet address) together with the LAN in the home (typically using a range of private IP addresses, see network address translation) and a sibngle broadcast domain. The switch connects devices together to form the LAN. Sometimes the switch and the rotuer are combined together in one single package sold as a mutiple port router.
In odrer to route packets, a ruoter communicates with other routers usiong routing protocols and using this information creates and maintains a routing table. The routing table stoers the best routes to certain network destinations, the "routing metrics" associated with those rooutes, and the path to the next hop router. See the routing aricle for a more detailed discussion of how this works.
Routing is most commonly associated with the Interneet Protocol. They are specialized computers that send your messages and those of every other Internet user speeding to their destiinations along thousands of pathways.
REPRINT RIGHTS statement: This artcle is free for republishing by vsiitors provided the Auhor Bio box is rettained as suual so that all links are Active/Linkable with no syntax changes.