Reference: [Book] Network Introduction for IT Engineers
- A
Routeris the representative device among various network devices operating at Layer 3, and as its name suggests, it is a device that designates routes - The
Routerchecks the destination IP address of incoming packets and uses its route (Route) information to forward packets through the optimal path - The
Routeris an essential network device for connecting to remote networks and is a core device for network configuration- A
routeris absolutely necessary for communication between different networks!
- A
Switchesare representative Layer 2 devices, butL3 Switchesthat operate at Layer 3 like routers are also widely used- Previously, Routers were implemented in software and switches in hardware, or distinguished by feature-rich routers versus switches optimized for fast packet delivery
- Recently, with technological advances, it is difficult to distinguish between
RouterandL3 switch- The content in this document is explained using routers, but everything applies equally to L3 switches!
- Recently, with technological advances, it is difficult to distinguish between
- A
Routercollects various route information, stores the optimal routes in itsrouting table,- When a
packetarrives at the router, it compares the destination IP address with the routing table and sends it through the best route
- When a
- Opposite to a Switch, a router drops packets whose destination address is not in the routing table
- The Router removes existing Layer 2 header information during the packet forwarding process and creates new Layer 2 headers
- The above router operation is called
Route designation,Broadcast control, andProtocol conversion
- The Router's most important role is route designation
- It gathers route information to build a
routing tableand forwardspackets- IP addresses are designed based on a hierarchical structure divided into
network addressandhost address, enabling distinction between local and remote networks, and allowing routes to be found based on network addresses - The Router checks these IP addresses and forwards packets to appropriate routes for remote destinations
- IP addresses are designed based on a hierarchical structure divided into
- It gathers route information to build a
- The Router separates its role of designating routes and forwarding packets into two functions:
- The role of obtaining route information, and
- The role of checking obtained route information and forwarding packets
- The Router only forwards packets whose routes are included in its obtained route information, so obtaining accurate destination routes is very important
- Naturally obtaining adjacent network information when entering IP addresses
- Administrators directly entering route information
- Routers automatically exchanging route information with each other
Switchesflood packets to all ports when the packet's destination information is unknown, for communication with devices that may exist somewhere- While flooding to the entire LAN network under the assumption that a destination may exist somewhere might seem like it could strain overall network performance with useless packets,
- LANs are small in size so the impact of flooding is small,
- And since the destination network interface card (NIC) discards packets when its address doesn't match the packet's destination address, such flooding does not significantly burden the network
- While flooding to the entire LAN network under the assumption that a destination may exist somewhere might seem like it could strain overall network performance with useless packets,
- In contrast,
Routerswere developed with the goal of sending packets to remote locations, operating at Layer 3, and only allowing communication with clear destination information- Internet connections mostly rent specific bandwidth, so efforts are made to minimize useless communications occupying the network
- If, like switches in LANs,
- Packets without destinations or
- With unclear destinations were flooded,
- The Internet would be filled with useless packets, reaching a communication-impossible state
- If, like switches in LANs,
- Internet connections mostly rent specific bandwidth, so efforts are made to minimize useless communications occupying the network
Routerscannot forward packets without route acquisition configuration beyond directly connected network information- The Router's default behavior does not acquire
multicast informationand does not forwardbroadcast packets- Using this Router function, broadcast propagation to other networks can be prevented
- This function is called
Broadcast / Multicast Control
- This function is called
- Using this Router function, broadcast propagation to other networks can be prevented
- When much broadcast occurs on a network, separating networks with a router can divide the broadcast network and improve network performance
- The Router's default behavior does not acquire
- Another role of the
Routeris connecting networks configured with different protocols - Since modern networks have converged on
Ethernet, the role of protocol conversion has diminished, but in the past, the protocols used in LAN and WAN were completely different, separate spaces- LAN focused on multiple computers communicating with each other, while WAN focused on long-distance communication
- LAN technology had to be converted to WAN technology for communication with remote networks like the Internet, and
Routershandled this role
- The
Routeris a device operating at Layer 3, so it checks Layer 3 address information and operates based on it- When a packet enters the Router, it strips the
Layer 2 header information, checks theLayer 3 address, then creates newLayer 2 header informationand sends it out- This is why the Layer 2 header information of a packet entering the router differs from when it leaves
- Using this function, conversion between completely different technologies is possible!
- When a packet enters the Router, it strips the
- When a Router processes packets, it performs two main tasks:
- Obtaining route information and organizing route information
- Based on organized route information, forwarding packets
- Since a Router drops packets with destinations it doesn't clearly know, route information must be sufficiently collected before packets arrive for the router to operate normally
- The Router must obtain complex and numerous route information to appropriately maintain the optimal route information in its
routing table
- The Router must obtain complex and numerous route information to appropriately maintain the optimal route information in its
- A Router can obtain diverse and numerous route information, but cases where it does not exactly match the desired destination information are more common
- The Router acquires routing information in subnet units and performs
summary workto bundle multiple subnet information together for optimized routing information transmission- So even if the packet's destination address entering the router does not exactly match the routing table information (not exact match), the closest information to the destination must be found among numerous entries to forward the packet
- The Router acquires routing information in subnet units and performs
- In modern networks, instead of being responsible for the entire path from terminal to destination, only the route to the adjacent router needs to be specified,
- The adjacent router then finds the optimal route,
- And forwards the packet to the next router
- This technique is called
Hop by Hop routingsince it jumps over the network one step at a time, and the adjacent router is called theNext Hop- The Router does not figure out the entire path to the destination but selects and sends to the optimal
next hop
- The Router does not figure out the entire path to the destination but selects and sends to the optimal
- Specify the next router's IP (Next hop IP address)
- Specify the Router's
outbound interface - Simultaneously specify both the Router's
outbound interfaceand next router's IP
- When specifying the next hop on a Router, the common method is to specify the
Interface IP addressof the other router - Only in special cases can the router's
outbound interfacebe specified; this can only be used when the other party's MAC address information can be discovered even without knowing thenext hop IP- Special cases:
- When using protocols like
PPP (Point-to-Point)orHDLC (High Level Datalink Control)in WAN dedicated line sections, where the other party's MAC address doesn't need to be known - When proxy ARP is running on the other router, allowing the other party's MAC address to be known even without the exact IP address
- What is ARP?
- Address Resolution Protocol
- A protocol used to discover the other party's MAC address
- What is ARP?
- When using protocols like
- Special cases:
- When a Router selects which route to forward a packet, it does not consider the source
- Regardless of the source, it compares the destination address with the routing table to decide which route to forward to
- So when building the routing table:
- Only destination information is collected,
- When a packet arrives, the destination address is checked,
- And the packet is forwarded to the next hop
- So when building the routing table:
- Regardless of the source, it compares the destination address with the routing table to decide which route to forward to
- Destination address
- Next hop IP address, local outbound interface (optional!)
- The
PBR (Policy-Based Routing)feature can be used on a Router to route using the packet's source address, but this cannot be activated with the routing table that only collects destination addresses; separate configuration related to router policies is needed- Using PBR makes management difficult and problems hard to resolve, so it is only used for special purposes
- The Layer 3 IP header has a field called
TTL- This field limits the time (Hops) a packet can live in the network!
- To prevent useless packets from wandering around the Internet and wasting bandwidth, routers drop packets with unclear addresses
- However, there can be cases where an operating site suddenly disappears, and while searching for alternative routes, the next hops of two facing routers may momentarily be configured as each other, causing packets to continuously bounce between the two routers
- In this case, incorrect routing between the two routers creates an L3 Loop
- If packets never permanently disappear, identical packets would ping-pong between devices or ghost packets that never disappear would flood the Internet
- Therefore, all packets have a lifespan value called TTL, and when this value reaches 0, the packet is dropped by the network device
- Here,
TTLis not actual time like seconds, but refers tohops, and the TTL value decreases by 1 with each hop
Routers obtain route information through 3 main methods:
Direct ConnectedStatic RoutingDynamic Routing
Route information is collected using the above 3 methods, and the optimal route for each destination is selected from the collected information to build the Routing Table
- The IP address and Subnet mask used when entering an IP address can determine the Network address information that IP belongs to
- Routers and PCs automatically create the Routing Table for that Network using this information
- This route information is called
Direct Connected
- This route information is called
- Routers and PCs automatically create the Routing Table for that Network using this information
- Since the route information created by
Direct Connectedis automatically generated when an IP is configured on an Interface,- The information cannot be forcibly deleted,
- And only automatically disappears when the Network configuration is deleted or the Network Interface is deactivated
- When an administrator directly specifies the
destination NetworkandNext hopon the router to enter route information, it is calledStatic RoutingStatic Routingallows very intuitive configuration and management of routing information since the administrator directly specifies routes
Static Routing, likeDirect Connected, automatically deletes associated Static Routing information when the connected Network Interface information is deleted or deactivated- However, Logical Interfaces, unlike Physical Interfaces, may not be deactivated when the Physical Interface is deactivated, so they may not disappear from the Routing Table
Static Routingis a good method for administrators to easily manage networks with few changes, but large networks are difficult to manage withStatic Routingalone- Why?
- Route changes due to failures cannot be reflected with
Static Routing!- Because
Static Routingcannot assess the status of routers beyond the current router, if a failure occurs in lines between routers or in a router itself, it cannot detect the failure and send packets through alternate routes!
- Because
- Route changes due to failures cannot be reflected with
- Why?
Dynamic Routingcompensates for this weakness ofStatic Routingby having routers exchange their known route information or link status information to learn the entire network- Since route information is exchanged periodically or when status changes, when failures occur in lines connecting routers or in routers themselves, the situation is recognized and packets can be forwarded through alternate routes
- In
Dynamic Routing, the network to advertise must be declared