Wednesday, 19 May 2010

Routing


Router functions



  • Packet switching

  • Packet filtering

  • Internetwork communication

  • Path selection


Routing protocols






Routing protocol functions:



  • Learn routing information about IP subnets from other neighboring routers

  • Advertise routing information about IP subnets to other neighboring routers

  • If more than one possible route exists to reach one subnet, pick the best route based on a metric

  • If the network topology changes—for example, a link fails—react by advertising that some routes have failed, and pick a new currently best route. This process is called convergence.)


Classfull and classless routing

This is the essence of classful routing: If one part of a major network is known, but the subnet toward which the packet is destined within that major network is unknown, the packet is dropped, even a default route is configured.

ip classless command will save you

The ip route command has two basic formats. The command can refer to a next-hop IP address. Alternately, for static routes that use point-to-point serial links, the command can list the outgoing interface instead of the next-hop IP address.



Static routing

Using static routes is appropriate with stub networks, for example the route from provider to client.



Distance vector loop prevention


  • Route poisoning - when route fails, router sends this route with metric 16(infinity)

  • Split horizon - In routing updates sent out interface X, do not include routing information about routes that refer to interface X as the outgoing interface. Poison reverse is used in Cisco instead of it.

  • Triggered update - when a route fails, do not wait for the next periodic update. Instead, send an immediate triggered update listing the poisoned route.

  • Poison reverse - when learning of a failed route, suspend split-horizon rules for that route, and advertise a poisoned route.

  • Holddown - the holddown process tells a router to ignore new information about the failed route, for a time period called the holddown time


Default gateway

There are 3 methods to configure default gateway:


  • ip default-gateway. It should only be used when ip routing is disabled on the Cisco router.

  • ip default-network. When you configure ip default-network the router considers routes to that network for installation as the gateway of last resort on the router. For every network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route.

  • ip route 0.0.0.0 0.0.0.0








Troubleshooting

show ip protocols

Shows the parameters and current state of the active routing protocol process.







IPv6


IPv6 advantages
  • Address assignment features
  • Aggregation
  • No need for NAT/PAT
  • IPsec
  • Header improvements
  • Transition tools
IPv6 is assigned by ICANN
ICANN > Regional Internet Registry (RIR) > ISP

Representing IPv6 Addresses
  • If quartet consists of all zeros, you can leave only one zero
  • Represent 1 or more consecutive quartets of all hex 0s with a double colon (::), but only for one such occurrence in a given address
  • The last/third major part is the host part of the address, called the interface ID in IPv6, and is meant to uniquely identify a host inside a subnet.
Prefix types
  • Registry prefix: By ICANN to an RIR
  • ISP prefix: By an RIR to an ISP
  • Site prefix: By an ISP to a customer (site)
  • Subnet prefix: By an enterprise engineer for each individual link
Addresses assignment
  • 2000::/3 - unicast global addresses
  • FF00::/8 - multicast
  • FF02::2 - All routers on this link - multicast for router solicitation (RS) messages
  • FF02::1 - All IPv6 nodes on this link - multicast for router advertisment(RA) messages
  • FD00::/8 - unique local unicast addresses
  • FE80::/10 - link local addresses. IPv6 uses these addresses when sending packets over the local subnet; routers never forward packets destined for link local addresses to other subnets. The host uses its link local address as the source IP address in the RS message. This address is calculated by host: first ten bits is 1111111010, next 54 bits is 0, and the last 64 bits is EUI. Interestingly, routers normally use link local addresses as the next-hop IP address in IPv6 routes, rather than the neighboring router’s global unicast or unique local unicast address.
  • ::1 (127 binary 0s and a 1) - loopback
  • :: - inknown address
Address configuration
  • Stateful DHCP - the same as IPv4 DHCP, but instead of broadcast, multicast is used, FF02::1:2 - has been reserved in IPv6 to be used by hosts to send packets to an unknown DHCP server, with the routers working to forward these packets to the appropriate DHCP server
  • EUI-64 - configuration of ip address based on mac address. Splits MAC into two 3 byte halfs and inserts between them FFFE. Also 7th bit in the first byte of MAC is set to 1
  • Stateless DHCP - is most useful in conjunction with stateless autoconfiguration. It can supply DNS server ip address. It can't supply host IP address. It doesn't remember state information.
  • Stateless autoconfiguration - a host dynamically learns the /64 prefix used on the subnet, and then calculates the rest of its address by using an EUI-64 interface ID based on its network interface card (NIC) MAC address. IPv6 Neighbor Discovery Protocol (NDP) is used to discover the prefix used on the LAN. Stateless autoconfiguration uses two NDP messages, namely router solicitation (RS) and router advertisement (RA) messages, to discover the IPv6 prefix used on a LAN
  • Static assignment - full address or EUI-64(this is when last 64 bit of IPv6 address are filled with MAC address of the interface. MAC address is splitted into 2 3-byte parts and FFFE is inserted between them. Seventh bit in first byte of MAC must be 1)
Configuration
ipv6 unicast-routing global command
ipv6 router rip name global configuration command
ipv6 address address/prefix-length [eui-64] interface command
ipv6 rip name enable interface subcommand
Transition
  • Dual stack
  • Tunneling (if both end hosts support IPv6): IPv6 packet sent by a host is encapsulated into an IPv4 packet
  • Manually configured tunnels (MCT) - creates staticly with hands.Dynamic 6to4 tunnels - created dynamicly, based on the destination IPv6 address
  • Intra-site Automatic Tunnel Addressing Protocol (ISATAP) - Another dynamic tunneling method, typically used inside an enterprise. Unlike 6to4 tunnels, ISATAP tunnels do not work if IPv4 NAT is used between the tunnel endpoints
  • Teredo tunneling - tunnel between host, directly
  • NAT-PT (Network Address Translation–Protocol Translation) - communication between IPv4 only and IPv6 only hosts. Router configured with NAT-PT must know what IPv6 address to translate to which IPv4 address and vice versa. And like traditional NAT, NAT-PT allows static definition, dynamic NAT, and dynamic PAT, which can be used to conserve IPv4 addresses configured





IP

IP uses packets or L3 PDU.



Network Address Classes



  • A class 1-126. First bit is zero(0)

  • B class 128-191 second bit is zero (10)

  • C class 192-223 third bit is zero (110)

  • D class 224-239 224.0.0.0 and goes through 239.255.255.255 – multicast addresses.

  • E class 240-255


Some facts




  • Network address of all 0s is reserved and interpreted to mean “this network or segment.”

  • Network address of all 1s is reserved and interpreted to mean “all networks.”

  • Network 127.0.0.1 is reserved for loopback tests. Designates the local node and allows that node to send a test packet to itself without generating network traffic.

  • Node address of all 0s Interpreted to mean “network address” or any host on specified network.

  • Node address of all 1s Interpreted to mean “all nodes” on the specified network; for example, 128.2.255.255 means “all nodes” on network 128.2 (Class B address)

  • Entire IP address set to all 0s Used by Cisco routers to designate the default route. Could also mean “any network.”

  • Entire IP address set to all 1s (same as 255.255.255.255)Broadcast to all nodes on the current network; sometimes called an “all 1s broadcast” or limited broadcast.

  • ip subnet zero - you can use 0 subnet in configuration.

  • Configuring default gateway in Cisco



Reserved IP Address Space



  • Class A 10.0.0.0 through 10.255.255.255

  • Class B 172.16.0.0 through 172.31.255.255

  • Class C 192.168.0.0 through 192.168.255.255

  • 127.0.0.1

  • 169.254.0.0/16 – auto configuration ip addresses.



Addresses that can't be used as unicasts:


  • 127 network

  • 224-239

  • 240-255

  • Subnet number

  • Subnet broadcast


Troubleshooting

  • Shows detailed information about interfaces with ip configured.

show ip interfaces

  • Shows short information about interfaces(no subnet mask) with ip configured.

show ip interfaces brief








Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...