Thursday, February 28, 2013

IP Addressing and IP Forwarding Notes.


IP addressing Core Facts:


-32bit binary number (/32).
-Dotted decimal notation (10.1.1.2)
-Addresses are assigned to network interfaces.
-Computer with an IP is an IP host.
-IP host not separated by a router are in the same grouping (Same net).
-Groupings are called, networks, subnets, prefixes.

 Network Classes.





Class: A
Network and Host Bits: 8/24.
Range: 1­-126.
Default Mask: 255.0.0.0 .
Identifying Bit : 0.

Class: B .
Network And Host Bits: 16/16.
Range: 128-­191.
Default Mask: 255.255.0.0
Identifying Bits: 10

Class: C.
Network And Hosts Bits: 24/8.
Range: 192­-223.
Default Mask: 255.255.255.0
Identifying Bits: 110

Class: D.
Network and Host Bits: N/A
Range: 224­-239
Default mask: N/A.
Identifying Bits: 1110

Class: E.
Network and Hosts Bits: N/A
Range: 240­-255.
Default Mask: N/A
Identifying Bits: 1111

Classless IP addressing.

Classless IP addressing is ignoring class A,B,C rules. Each address is viewed as a two part  address, called prefix and host part of the address.

Zero Subnet and Broadcast Subnet

The following subnets are recommended NOT to use:

-Zero Subnet.
-Broadcast Subnet.

By default cisco routers allows using both, to disable this behaviour use the global commnad [no ip subnet­zero] ­­.­

Note: only when using classful routing protocols the zero subnet causes trouble.

Classless Interdomain Routing.

CIDR defined at RFCs 1517 through 1520

CIDR itself refers to the administration assingment of large address blocks , and the related summarized routes, for the purpose of reducing the size of the internet routing tables.

Private Addressing



RFC 1918
­A: 10.0.0.0 to 10.255.255.255 (1 net).
­B: 172.16.0.0 to 172.31.255.255 (16 nets).
­C: 192.168.0.0 to 192.168.255.255 (256 nets).

This are non­-internet routable IP addresses (PRIVATE RANGES).

IP Forwarding.

IP Header fields



­Version ­­­­­­--------> (v4,v6)
­Header Length --------­­­­­­> (IP header only).
­DS field ­­­­­------------------­> (Used for QoS).
­Packet length ­­­­----------­> (Total length including DATA).
­Identification ­­­­­-----------> (Fragmentation related).
­Flags ­­­­­­---------------------> (3 bits, used for fragmentation proccess).
­Fragment offset ­­­­­-------> (Fragmentation related).
­TTL ­­­­­­­------------------------> (Time to Live).
­Protocol ­­­­­------------------> (Identifies protocol of the data portion of the header).
­Header Checksum ­­­­­-----> (FCS).
­Source IP address ­­­­­-----> (10.1.1.1).
­Destination IP address -----­­­­­> (10.1.1.100).
­Optional header fields and padding ------­­­­> (optional).

IP protocol fields value.

­ICMP = 1
­TCP = 6
­UDP = 17
­EIGRP = 88
­OSPF = 89
­PIM = 103

IP forwarding (IP Routing) is simply the proccess of receiving an IP packet , making a decision of where to send the packet next, and then forwarding the packet.

Fast Switching and CEF.

Cisco two optimization methods for the forwarding proccess are: Fast Switching and CEF.

With fast switching the first packet to a destination is proccess switched. The router then adds an entry to the fast ­switching cache (route cache). The route cache contains the destination IP address, next-­hop information and the data link header information. Future packets to the same destination match the cache entry, so it takes the router less time to process and forward the packet.

Drawbacks of Fast Switching.

-First packet must be proccess switched.
-Cache entries are timed out relatively quickly.
-Load balancing only occur per destination with fast switching.

CEF (Cisco Express forwarding).

CEF uses a FIB (Forwarding information base). The FIB contains information about all the known routes in the routing table.

CEF loads FIB entries as routes are added and removed from the routing table.

Cons of CEF vs Fast Switching.

-CEF loads FIB entries as routes are added and removed from the routing table.
-CEF does not timeout entries.
-Does not proccess­switch the first packet to a destination.
-Load balancing over equal cost routes.

When a new packet arrives the router first search the FIB.

The CEF FIB structure is a special kind of tree called mtrie. The matching FIB entry points to an  entry in the CEF adjacency table.

The adjacency table list the following:

-Outgoing interface.
-Information needed to build the data link header and trailer.

Type of switching methods Review.

Process switching.
 -­Table that holds forwarding Information: Routing table.
 ­-Load balancing method: Per packet.

­Fast Switching.
 ­-Table that holds forwarding information: Fast switching cache.
 ­-Load balancing method: Per Destination IP address.

­CEF.
 -­Table that holds forwarding information: FIB and Adjacency table
 -­Load balancing method: Per hash of the packet source and destination , or per packet.

Commands used to enable and disable CEF.

[ip cef] global command enables CEF for all interfaces on a cisco router.

[no ip route-­cache cef] interface command is used to selectively disable CEF on an interface.

Classless and Classful routing.

Classless and classful routing relates to the logic used to match the routing table. ( especially when the default route is used)

Statements about classless and classful routing.

Classless routing: When a default route exists, and no specific match is made when comparing the destination of the packet and the routing table, the default route is used.

Classfull routing: When a default route exist, and the class A,B,C network for the destination IP address does not exist at all in the routing table, the default route is used. If any part of that classful network exist in the routing table, but the packet does not match any of the existing subnet of the  classful network, the router does not use the default route and thus discards the packet.

[ip classless] global command is used to enable classless routing.

Multilayer Switching.

MLS steps to foward (route) a packet.

-MLS routing table entry list and outgoing interface and next­hop ip address
 Adjacency information (CEF).
-L2 logic to decide to which Physical interface to forward the packet.

Routed ports and Port-­channels.

A routed port is a switchport configured to work as a L3 port.

Routed port characteristics:

-Interface is not on any VLAN (Not even VLAN1).
-The switch does not feed any L2 switching table information for the interface
-L3 settings are configured under the physical interface
-Adjacency table lists the outgoing interface/port channel which means that L2 switching logic is not required.
-The [no switchport] command is used to turn a switchport into a routed port.
-For port­channels the physical interface must also be configured with the [no   switchport] command also port­-channel load balancing should be based on L3 addresses.

MLS L3 interfaces Types.

­Vlan Interface:
 ­-Forwarding to adjacent device: Uses L2 logic and L2 mac address table.
 ­-Config Requirements: Create VLAN interface; VLAN must exist.

­Physical routed interface.
 -­Forwarding to adjacent device: Forwards out the physical interface.
 ­-Configuration Requirements: Use [no switchport] command to create a routed       interface.

­Port­-channel (Switched interface).
 -Forwarding to adjacent device: Not applicable, just another L2 path
 ­-Config requirements: none

­Port­-channel (routed interface).
 -­Forwarding to adjacent device: Balances across links in Port-Channel.
 ­-Config Requirements: [no switchport] command.

Policy Routing.

Policy routing allows the router to make routing desicions based on information beside the destination IP address.

The [ip policy] command tells IOS to proccess incoming packets with different logic before normal  forwarding takes place.

IOS compares the received pakcet using a route­map reference in the IP policy command. route maps must match either based on referring to a acl or based on packet length. 

The routing instructions are specified using a set command.

Policy routing set commands.

-set ip next­hop ­­­­> must be in a connected subnet
-set ip default next­hop ­­­­-------> same as ip next­hop but uses Routing table logic.
-set interface
-set default interface -----­­­> do not use a lan or P2MP FR interface
-set ip precedence
-set ip tos

IP policy verification commands.

-show ip policy.
-debug ip policy.


No comments:

Post a Comment