Devices

Device Information: Routers

This page explains the router's properties and functions as implemented by Packet Tracer 3.2.

A router supports multiple ethernet and/or WAN ports.

- Each Ethernet port has a MAC address, an IP address, and a subnet mask.
- Each WAN port has an IP address and a WAN address.

If a router is using Automatic Dynamic Routing, it uses RIP version 2 to find routes to remote networks automatically.

- A router advertises all networks its ports belong to, specified by the IP address and subnet mask.
- RIP version 2 supports VLSM (variable-length subnet masking).
- The setting "no auto-summary" is on by default
- RIP keeps a routing table of remote networks.
- The routing table associates a network (network ID and subnet mask or network bits) to the closest port on the router.

When a router receives a RIP version 2 update:

- It checks if the receiving port is RIP enabled.
  - If the receiving port is not RIP enabled, then drops the packet.
- It checks if the packet is from another network.
  - If the packet is from another network, then drops the packet.
- It creates a routing entry with advertised network and subnet mask, the receiving port, the packet's source IP address as the next hop, and one less than the advertised metric as the metric.
- It looks up the routing table for an entry with the same network and subnet mask.
  - If a matching entry is found or the new entry has a smaller metric than the old one, then removes the old one from the routing table, adds the new one, and advertises the new route out all ports except the receiving one.
  - If a matching entry is found with the same metric, then adds the new one to the routing table so load balancing is possible.
  - If a matching entry is found with smaller metric than the new one, then drops the update.

A router keeps an ARP table.

- It associates IP addresses with MAC addresses using an ARP table.
- A router builds its ARP table by sending ARP requests to find the MAC address of an IP address. The device in question receives the request and sends an ARP reply back with its MAC address. When the router receives the reply, it adds the entry to the ARP table.
- The ARP process is not visible to the user.

When a router receives a data frame/packet (view packet process flowchart):

- It checks if the receiving port is a WAN port.
  - If not a WAN port, then it checks if the frame is a broadcast frame.
    - If it is a broadcast frame, then drops the frame.
    - If not broadcast frame, then checks if destination MAC address matches the receiving port's.
      - If the destination MAC address does not match, then drops the frame.
- It checks the TTL field to see if the packet is to be forwarded.
  - If the TTL field is 0, then drops the packet.
- It checks if the receiving port has an inbound access list.
  - If an inbound access list exists, then checks if the packet passes the access list.
    - If the packet does not pass the access list, then drops the packet.
- It checks if the receiving port is a NAT outside port.
  - If the receiving port is a NAT outside port, then looks up the packet's destination IP in the NAT table as global address.
    - If the NAT table has a matching entry, then translates destination IP and port numbers to the entry's.
- It looks up its routing table to find the network that the packet’s destination IP address belongs to.
  - If the routing table has a matching entry, then checks if network is directly connected.
    - If the network is directly connected, then marks the packet's destination as the next hop level 2 destination.
    - If the network is not directly connected, then marks the layer 3 next hop as the next hop level 2 destination.
  - If the routing table does not have a matching entry, then checks if the router has a gateway of last resort.
    - If a gateway of last resort exists, then marks the gateway of last resort as the next hop level 2 destination.
    - If a gateway of last resort does not exists, then drops the packet.
- It checks if the receiving port is a NAT inside port and the outgoing port is a NAT outside port.
  - If so, then looks up the packet's source IP in the NAT table as local address.
    - If the NAT table has a matching entry, then translates the source IP and port numbers to the entry's.
    - If the NAT table does not have a matching entry, then checks if the packet matches any inside NAT source list.
      - If the packet matches a source list.
        - It adds a new NAT entry to the NAT table describing this translation.
        - It translates the source IP and port numbers to the entry's.
- It checks if the outgoing port has an outbound access list.
  - If an outbound access list exists, then checks if the packet passes the access list.
    - If the packet does not pass the access list, then drops the packet.
- It checks if the outgoing port is a WAN port.
  - If a WAN port, then sets the frame's destination address to the all-destination address.
  - If not a WAN port, then look up the next hop level 2 destination MAC address in the ARP table.
    - If a matching entry is found in the ARP tale, then sets the frame's destination address to the MAC address of the next hop level 2 destination and the frame's source address to the MAC address of the outgoing port.
    - If a matching entry is not found, then drops the frame.
- If the frame/packet is not dropped, then forward the packet out the outgoing port.

A router supports DHCP:

- A router may act as a DHCP server for LANs it is connected to.
- If a DHCP-enabled router receives a DHCP request, it will send a DHCP reply back to the host.
- The DHCP reply contains the host's assigned IP address, subnet mask, and default gateway.
  - The default gateway is the IP address of the port on the router that received the DHCP request.
  - The subnet mask is the same as that port’s.
  - The IP address is the next available IP address in that port’s network.
- Note that DHCP packets are not shown to the user.