Routing
- Introducing Routers
- Routers only care about destinations.
- Routers interconnect Network IDs.
- Routers can use any network medium!
- Routes are not tied to Ethernet; They can have DSL, Fiber-Optic connections, etc.
- All routers have a routing table!
- A routing table will have at least 4 columns: Address, Subnet, Gateway, & Interface.
- A router is a box that connects network IDs. Routers filter & forward based on IP address (Remember, “switches” filter & forward based on MAC address.)
- Default Routes
- have “Address” and “Subnet” data of “0.0.0.0”
- The primary job of a router is to connect networks with different network IDs.
Understanding Ports
- Understanding Ports
- Port numbers identify the sending & receiving processes between 2 hosts.
- Every TCP packet has two (2) port numbers. (A destination port number and a source port number.)
- Well-known port numbers run from 0 to 1023.
- These have fixed applications & are pretty much locked in stone.
- Clients generate ephemeral numbers that are always between 1024 & 65,535.
- Your computer generates the ephemeral (fleeting) port number.
- NAT Network Address Translation
- Port Address Translation (PAT)
- PAT translates internal IP addresses to an Internet address and tracks the packets.
- Static NAT–SNAT (like port forwarding)
- SNAT sends specific traffic to one internal IP address.
- all incoming addresses for one particular IP addressee go to one particular device (client).
- Dynamic NAT–DNAT (aka pooled NAT)
- DNAT has a limited pool of Internet addresses to give to a number of internal devices.
- *Note: NAT routers replace the source IP address with its own IP address and then restore the original IP header when a response comes back so that the results can be sent to the originator.
- Implementing NAT
- SOHO (Small Office/Home Office) routers ship with NAT enabled, typically.
- NAT on a SOHO router can be disabled from the router’s configuration page/the routers administration settings.
- Some older routers call this setting “gateway/router mode”.
- Forwarding Ports–(enables access to hosts on the LAN side of a NAT router from beyond the WAN interface of the router.)
- Port forwarding allows external devices to have internal communication through a router.
- Port triggering will open an alternative assigned port when the initial port is contacted (e.g. FTP)
- Enabling DMZ when setting up port forwarding places that device outside the protection of that router.
- Tour of a SOHO Router (*NOTE–The 1st security task on a SOHO router should be to change the default admin name & password!!!)
- All home routers have a default IP address, user name, & password.
- Almost all home routers are DHCP servers.
- Router WAN connections are commonly DHCP clients by default.
- SOHO vs. Enterprise
- SOHO routers are for small groups (5-6 devices) and can have built-in capability for switches, firewalls, & WAPs.
- Enterprise routers have expanded connection capability to other devices (i.e.–routers, switches, & WAPs).
- SOHO routers often have Web-based interfaces; enterprise routers typically have their own OS interface.
- Enterprise-level routers typically focus solely on being a router! (Very few enterprise routers have a built-in switch.)
- Enterprise routers offer more advanced, robust features.
- Enterprise router bandwidth can be 10, 20, up to 100x stronger than on a SOHO router.
- can support more computers.
- Use different set-up software, like Cisco’s iOS interface, which is a CLI interface.
- SOHO & Enterprise are similar in that they both still route data between different segments to get your data, wherever you need it to go.
- Static Routes
- A static route is a fixed route that is manually configured & persistent. (Once entered, it cannot be automatically changed by a router.)
- Use ‘route print’ or ‘netstat -r’ to display current known routes from the routing table.
- Routing tables contain address information for destination, subnet mask, gateway, & NIC.
- Note: When a router automatically changes a route, this is called dynamic routing and is the opposite of static routing.
- Dynamic Routing–routers re-writing their routing tables “on-the-fly”.
- Dynamic routing protocols use metrics to determine routes and are either distance vector or link state.
- Dynamic routing protocols are either IGP (Interior Gateway Protocol) or EGP (Exterior Gateway Protocol)
- BGP (Border Gateway Protocol) is the EGP protocol used for Inter-Autonomous System (IAS) routing.
- AS (Autonomous System)–one organization that has control of their set of routers. EGP is used communicating OUTSIDE of an A.S..
- Convergence–is where all router tables reflect all routes.
- Metric Value–can be based on:
- Hop Count: number of routers used to get to a particular network ID.
- Note: Hop distance (the physical distance between 2 routers) is NOT considered when defining a metric.
- MTU (Maximum Transmission Unit)–essentially means, in a particular given frame, how much data can be hauled.
- ex: Ethernet has an MTU of 1500 bytes.
- Note: The internet is more than just Ethernet; Data can be sent via cable (DOCSIS–Data Over Cable Service Interface Specification), DSL, Telephone Lines with SONET & ATM; all of these are Layer 1 & Layer 2 protocols that “haul” things in different ways. When data travels between these different protocols; they have different MTUs that the data has to “conform” to.
- Bandwidth–ex: 56k vs. 10GB line (10GB is clearly the preferable route)
- Cost
- Latency–lag; how long does it take a particular route to react to what has to be done. (ex: Satellite has a long latency because the signal has to travel out to space & back.)
- MTU, Bandwidth, Cost, and Latency are called “Route Metric Elements”.
- Remember, the main takeaway is that the metric value is an arbitrary value & different dynamic routing protocols use it in different ways to get wherever they need to get with it.
- Distance Vector–the “old Granddaddy” of dynamic routing protocols.
- sending routing tables to all of their neighbors for comparison to determine best routes to use.
- Issues with Distance Vector:
- Distance vector uses Hop Count (which can be a negative aspect)
- The other issue is that Distance Vector sends at given intervals creating a time-wait.
- Link State–more modern than Distance Vector
- uses “advertising”; or it kind of constantly updates by sending “pings” or “hellos” to stay abreast of any changes and/or be able to detect any changes, and thus notify neighbors of any updates needed to their individual routing tables.
- This all takes place “on-the-fly” as opposed to waiting for specific intervals.
- *In general, a link state dynamic routing protocol will get back into a convergence world much faster than distance vector dynamic routing protocols.
- BGP (Border Gateway Protocol)
- the “Big Kahuna”; the cornerstone of the Internet: the only EGP protocol that there is. (Universally used by all big ISPs.)
- BGP is a hybrid protocol (it has aspects of Distance Vector & Link State).
- BGP is the primary protocol for the internet.
- BPG is based around the concept of autonomous systems.
- BGP uses OSPF (and other routing protocols) within autonomous systems, but not between different ASes.
- RIP (Routing Information Protocol)
- (RIP is one of the oldest dynamic routing protocols around.)
- RIP is a distance vector protocol that uses hop count to determine route. RIP is an IGP (interior gateway protocol).
- RIP1 used only classful networks
- RIP’s maximum hop count is 15.
- OSPF–(Open Shortest Path First)
- OSPF is link state protocol.
- OSPF uses Area IDs.
- OSPF converges very quickly.
- OSPF is IGP and it uses Link State protocol.
- OSPF routers in an area elect a designated router & a backup designated router.
- OSPF routers are groups into areas.