A router is a device that sends data packets over a network or the Internet to its destination, through a process known as routing. The routing process occurs on layer 3 (Network layer such as Internet Protocol) of the OSI seven-layer stack protocol.
The router functions as a liaison of 2 or more networks to forward data from one network to another. A router is different from a switch. Switch is a link between several devices to form a Local Area Network (LAN). As an illustration of the different functions of routers and switches, a switch is a way, while a router is a liaison between roads. Each house is on a street that has an address in a certain order. In the same way, switches connect various devices, where each device has its own IP address on a LAN.
Routers are widely used in networks based on TCP / IP protocol technology, and routers of this type are also called IP Routers. In addition to the IP Router, there is another AppleTalk Router, and there are still several other types of routers. The internet is a prime example of a network that has many IP routers. Routers can be used to connect many small networks to a larger network, called an internetwork, or to divide a large network into several subnetworks to improve performance and also simplify management. Routers are also sometimes used to connect two networks that use different media (such as a wireless router that in general, in addition to being able to connect computers using radios, it also supports connecting computers with UTP cables), or different network architectures, such as from Ethernet to the Token Ring.
Routers can also be used to connect LANs to a telecommunications service such as leased lines or Digital Subscriber Line (DSL) telecommunications. The router used to connect LANs to a leased line connection such as T1, or T3, is often referred to as an access server. Meanwhile, the router used to connect a local network to a DSL connection is also called a DSL router. These types of routers generally have a firewall function to filter packets based on the source address and destination address of the packet, although some routers do not have one. A router that has a packet filtering feature is also called a packet filtering router. Routers generally block data traffic that is broadcasted so that it can prevent a broadcast storm that can slow down network performance.
In general, routers are divided into two types, namely:
static router: is a router that has a static routing table that is set manually by network administrators.
dynamic router: is a router that has and creates dynamic routing tables, by listening to network traffic and also by connecting with other routers.
Router VS Bridge
The way a router works is similar to a network bridge, in that they can forward network data packets and can also divide the network into segments or unite network segments. However, the router runs at the third layer in the OSI model (network layer), and uses the addressing scheme used at that layer, as well as the IP address. Meanwhile, the network bridge runs at the second layer in the OSI model (data-link layer), and uses the addressing scheme used at that layer, the MAC address.
As for Bridge, it should be used to connect network segments that run the same network protocol (for example: IP-based network segments with other IP network segments). In addition, bridges can also be used when there are protocols on the network that cannot do routing, such as NetBEUI. Meanwhile, routers should be used to connect network segments that run different network protocols (such as to connect IP network segments with IPX network segments.) In general, routers are smarter than network bridges and can increase network bandwidth, given the router does not forward the broadcast packet to the destination network. And, the most common use of routers is when we want to connect our network to the internet.