It is important to distinguish between a router, a bridge and a gateway. Bridge Interconnects LAN segments at the Network Interface layer level and forwards frames between them. It provides MAC layer protocol conversion, if required. Router Interconnects networks at the internetwork layer level and routes packets between them. The router must understand the addressing structure associated with the networking protocols it supports and take decisions on whether, or how, to forward packets.
Routers are able to select the best transmission paths and optimal packet sizes.
The term gateway is now normally used for connections at a higher level than the router level. That is, when a host sends an IP datagram to another host on a network connected by a router, it sends the datagram to the router and not directly to the target host. Gateway Interconnects networks at higher levels than bridges or routers. Gateways typically limit the interconnectivity of two networks to a subset of the application protocols supported on either one. The higher-level protocol information carried by the datagrams is then passed on by the gateway using whatever networking architecture is used on the other side of the gateway.