Wednesday, August 14, 2013

IP Accounting - A Deeper Look From QOS Prospective

Got a call from one of a Friend (Network Engineer) yesterday looking for a quick way to verify QOS marking for a specific traffic.

Now there are multiple ways to get this done. One of the easiest way is to use an ACL matching specific IP Precedence values and apply it on interface in incoming direction and see if you are getting hits. Though it's a quick way but there are some limitations as well. For example - Say I am expecting incoming traffic to carry IP Precedence 5 value. And if you are matching IP Precedence 5 in ACL, you should see hits on ACL. On the flip side if for some reason traffic lost it's marking some where in middle. You won't see hits. Which is what usually we need to know while troubleshooting. But on the flip side you still couldn't determine what was actual IP Precedence value that traffic was carrying at that point which didn't create hit on the ACL. 

Now you might be thinking, that's easy. We can create one ACL per IP Precedence value (Total 8) and we should be all good. Which is Okay. But lengthy way. Specially if you are little lazy at Typing like me :)

There is an alternate way as well. All most of us have used "IP Accouting" feature at some point of our Networking Career. But this feature has couple of more branches which are not explored that much per say. One of function it provides is something that can help us with above mentioned situation and even easier and faster in terms of configuration and verification.

Let's review our topology:


Say on R3, I am expecting Server to send traffic towards R3's Loopback with IP Precedence Value 5. But on the flip side I am really not 100% sure if that is really happening.

Now we can create 8 ACLs matching IP Precedence Values 0-7 and apply that ACL on F0/0 of R3 in incoming direction. And than later look at "sh access-list " command output to see which one out of eight ACL entries actually got hit to figure out which IP Precedence value traffic was actually carrying.

Nahhh..... Let's look at other way

Lets enable the feature on R3's F0/0 interface for incoming packets. Though this feature is supported in outbound direction as well.


R3#sh run int f0/0
Building configuration...

Current configuration : 125 bytes
!
interface FastEthernet0/0
 ip address 23.0.0.3 255.255.255.0
 ip accounting precedence input
 duplex auto
 speed auto
end


Lets send couple of pings to see our traffic is carrying which IP Precedence value:


SERVER#ping 3.3.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 352/428/524 ms

 
 Lets verify back on R3

R3#sh int f0/0 precedence
FastEthernet0/0
  Input
    Precedence 0:  5 packets, 570 bytes


As you can see we received the traffic on R3 marked with IP Precedence 0, Which means default value.

Hmmm... Seems like our QOS policy is not working.

Lets set up one and see if that changes the situation as per our requirement.

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#class-map match-all ICMP
R2(config-cmap)#match protocol icmp
R2(config-cmap)#exit
R2(config)#
R2(config)#policy-map PREC5
R2(config-pmap)#class ICMP
R2(config-pmap-c)#set ip precedence 5
R2(config-pmap-c)#exit
R2(config-pmap)#
R2(config-pmap)#int f0/1
R2(config-if)#service-policy output PREC5
R2(config-if)#end


Now as configuration seems to be in place to get our job done. Let's re-send the Pings from Server and see if they are carrying IP Precedence 5 now.


SERVER#ping 3.3.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 232/488/688 ms


Let's re-verify on R3

R3#sh int f0/0 precedence
FastEthernet0/0
  Input
    Precedence 0:  10 packets, 1140 bytes
    Precedence 5:  5 packets, 570 bytes


Hmmm....The policy seems to be working now. But old matches are still there and seems to be increased. Which looks confusing.

Okay, lets clear the mess and re-run the test and verify one last time.

R3#clear counters f0/0
Clear "show interface" counters on this interface [confirm]


R3#sh int f0/0 precedence
FastEthernet0/0
  Input
    (none)



Now counters are cleared. Let's Re-Test


SERVER#ping 3.3.3.3 r 10

Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 200/346/508 ms


Final Verification:

R3#sh int f0/0 precedence
FastEthernet0/0
  Input
    Precedence 5:  10 packets, 1140 bytes


 Nice... Isn't It ? :)

Further Readings

http://www.ciscopress.com/articles/article.asp?p=764234&seqNum=4

HTH...
Deepak Arora
Evil CCIE

Monday, July 22, 2013

FCoE - (Storage Series Part-10) Final

Fibre Channel Over Ethernet
+++++++++++++++++++++++++++

- Unified Fabric = Unified Wire = Converged Ethernet = Data Center Ethernet = Data Center Bridging

- In unified fabric  - Ethernet & Fibre channel both run on common infrastructure

- FCoE Initialization Protocol (FIP) is control plane protocol for FCoE running between Initiator & FCOE Switch/FCoE   Forwarder(FCF)

- ENode in FCoE = N port in FC

- Virtual Fibre Channel (VFC) interface is logical interface mapped with physical interfaces. FIP Runs between ENode &   VFC using P2P Adjacency

- Virtual Port Types in FCOE

 > VN Port = N Port in FC
 > VF Port = F Port in FC
 > VE Port = E Port in FC < Used in Multi Hop FCOE
 > VTE Port = TE Port in FC

- FCoE replaces layer 1 & layer 2 tranport for FC but all upper layer FC services remains same like Zoning, Domain IDs,   FSPF, FLOGI, FCNS etc

- FIP is control place of FCoE and FCoE itself is the actual data plane

# FIP
++++++

- FIP has new Ether Type as 0x8914

- FIP is used to discover FCFs and perform FLOGI

# FCOE
+++++++

- New Ethertype 0x8906

- Max length of 2240 bytes which implies jumbo frames are required

www.t11.org/fcoe


# FCoE Addressing
+++++++++++++++++

- Fibre Channel uses 3 bytes FCIDs

- Ethernet uses 6 byte MAC Addresses

- FCoE ENode gets a Fabric Provided MAC Address (FPMA) for FCoE

- During FIP, ENode is assigned a 3 byte FCID

- FLOGI now is part of FIP

- FCF is configured with a 3 byte FCoE MAC Address Prefix (FC-MAP)

- ENode appends FC-MAP to FCID

- 3 byte FC-MAP + 3 byte FCID = FPMA

# Configuring FCOE
+++++++++++++++++++

- feature fcoe < Feature FCOE can only be enabled from Admin VDC in Nexus 7k
- feature lldp

- Create a VSAN

vsan database
 vsan 1010
 vsan 1010 interface fc1/10

- Associate VSAN to a VLAN

vlan 1010
 fcoe vlan 1010

- Configure a VFC
- Associate Physical Ethernet to a VFC

int vfc117
 bind interface e1/17
 switchport trunk allowed vsan 1010

- Assign VFC to the VSAN

vsan database
 vsan 1010 interface vfc117

- Configure physical ethernet as a trunk

int e1/17
 shut
 switchport mode trunk
 spanning-tree port type edge trunk
 switchport trunk native vlan 10
 switchport trunk allowed vlan 10 ,1010

- Activate Interfaces

int vfc117
 no shut

int e1/17
 no shut



sh int vfc117 < Look for trunking & VSAN should be up

sh fcoe database

Nexus 5k doesn't support AL (Arbitrated Loop) topology

sh system internal dcbx info interface e1/17

> Look for DCX Protocol where CEE means Gen2 or Gen2+ CNA and anything else like CIN means Gen1 CNA

FCOE traffic is marked with COS-3 by default

SAN gets 50% of BW incase of congestion and rest 50% is reserved for LAN

sh int fcoe


Further Readings:

http://www.cisco.com/en/US/docs/switches/datacenter/nexus5000/sw/mkt_ops_guides/513_n1_1/n5k_ops_fcoe.html


HTH...
Deepak Arora
Evil CCIE

Friday, July 12, 2013

L2TPv3 Interworking - L2 VPN Saga Continues...


R8#sh ip int b | e una|do
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            89.0.0.8        YES NVRAM  up                    up
Loopback0                  8.8.8.8         YES NVRAM  up                    up

R8#sh run | s r o
router ospf 1
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0


R9#sh ip int b | e una|do
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/0                  89.0.0.9        YES NVRAM  up                    up
Loopback0                  9.9.9.9         YES NVRAM  up                    up

R9#sh run | s r o
router ospf 1
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0

R9#sh run int s1/0
Building configuration...

Current configuration : 132 bytes
!
interface Serial1/0
 ip address 89.0.0.9 255.255.255.0
 encapsulation ppp
 ip ospf network broadcast

 serial restart-delay 0
end


R2#sh ip int b | e una|do
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.0.0.2        YES NVRAM  up                    up
FastEthernet0/1            23.0.0.2        YES NVRAM  up                    up
Loopback0                  2.2.2.2         YES NVRAM  up                    up

R2#sh run | s r e
router eigrp 100
 network 0.0.0.0
 no auto-summary

R2#sh ip ro e
     1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/409600] via 12.0.0.1, 00:10:30, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/409600] via 23.0.0.3, 00:10:10, FastEthernet0/1

R2#sh mpls forwarding
Tag switching is not operational.
CEF or tag switching has not been enabled.
No TFIB currently allocated.



R1#sh run | s pseudo
pseudowire-class L2TPv3
 encapsulation l2tpv3
 interworking ip
 ip local interface Loopback0


R1#sh run int f2/1
Building configuration...

Current configuration : 124 bytes
!
interface FastEthernet2/1
 no ip address
 speed auto
 duplex auto
 no keepalive
 xconnect 3.3.3.3 13 pw-class L2TPv3
end


R3#sh run | s pseudo
pseudowire-class L2TPv3
 encapsulation l2tpv3
 interworking ip
 ip local interface Loopback0


R3#sh run int s1/1
Building configuration...

Current configuration : 122 bytes
!
interface Serial1/1
 no ip address
 encapsulation ppp
 serial restart-delay 0
 xconnect 1.1.1.1 13 pw-class L2TPv3
end


R8#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           1   FULL/DR         00:00:37    89.0.0.9        FastEthernet0/0

R8#sh ip ro os
     9.0.0.0/32 is subnetted, 1 subnets
O       9.9.9.9 [110/11] via 89.0.0.9, 00:13:00, FastEthernet0/0

R8#ping 9.9.9.9 so lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.9.9.9, timeout is 2 seconds:
Packet sent with a source address of 8.8.8.8
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 88/120/180 ms


R1#sh l2tp tunnel all

L2TP Tunnel Information Total tunnels 1 sessions 1

Tunnel id 1100418086 is up, remote id is 2518749472, 1 active sessions
  Remotely initiated tunnel
  Tunnel state is established, time since change 00:14:48
  Tunnel transport is IP  (115)
  Remote tunnel name is R3
    Internet Address 3.3.3.3, port 0
  Local tunnel name is R1
    Internet Address 1.1.1.1, port 0
  L2TP class for tunnel is l2tp_default_class
  Counters, taking last clear into account:
    111 packets sent, 107 received
    9008 bytes sent, 8752 received
    Last clearing of counters never
  Counters, ignoring last clear:
    111 packets sent, 107 received
    9008 bytes sent, 8752 received
  Control Ns 9, Nr 13
  Local RWS 1024 (default), Remote RWS 1024
  Control channel Congestion Control is disabled
  Tunnel PMTU checking disabled
  Retransmission time 1, max 1 seconds
  Unsent queuesize 0, max 0
  Resend queuesize 0, max 1
  Total resends 0, ZLB ACKs sent 11
  Total out-of-order dropped pkts 0
  Total out-of-order reorder pkts 0
  Total peer authentication failures 0
  Current no session pak queue check 0 of 5
  Retransmit time distribution: 0 0 0 0 0 0 0 0 0
  Control message authentication is disabled


R1#sh l2tun session all

L2TP Session Information Total tunnels 1 sessions 1

Session id 3278375310 is up, logical session id 65537, tunnel id 1100418086
  Remote session id is 1558878854, remote tunnel id 2518749472
  Remotely initiated session
  Unique ID is 1
Session Layer 2 circuit, type is Ethernet, name is FastEthernet2/1
  Session vcid is 13
  Interworking type is IP
  Circuit state is UP

    Local circuit state is UP
    Remote circuit state is UP

Call serial number is 1168000001
Remote tunnel name is R3
  Internet address is 3.3.3.3
Local tunnel name is R1
  Internet address is 1.1.1.1
IP protocol 115
  Session is L2TP signaled

  Session state is established, time since change 00:15:43
    117 Packets sent, 113 received
    9488 Bytes sent, 9232 received
  Last clearing of counters never
  Counters, ignoring last clear:
    117 Packets sent, 113 received
    9488 Bytes sent, 9232 received
    Receive packets dropped:
      out-of-order:             0
      other:                    0
      total:                    0
    Send packets dropped:
      exceeded session MTU:     0
      other:                    0
      total:                    0
  DF bit off, ToS reflect disabled, ToS value 0, TTL value 255
  Sending UDP checksums are disabled
  Received UDP checksums are verified
  No session cookie information available
  FS cached header information:
    encap size = 24 bytes
    45000014 00000000 ff73b36f 01010101
    03030303 5cea9a86
  Sequencing is off
  Conditional debugging is disabled
  SSM switch id is 4096, SSM segment id is 8193


 Final Config - http://www.4shared.com/rar/T4TwmRG7/Interworking.html 

Further Readings:

http://www.cisco.com/en/US/docs/ios-xml/ios/mp_l2_vpns/configuration/15-2mt/mp-l2vpn-intrntwkg.html#GUID-E774CB40-066C-4B3F-8E1E-BEBCBED1087C

http://www.cisco.com/en/US/docs/ios/12_0s/feature/guide/fsinterw.html#wp1057606

http://blog.ine.com/2008/01/28/poor-mans-vpls/


HTH...
Deepak Arora
Evil CCIE






Tuesday, July 9, 2013

NPV & NPIV - (Storage Series Part-9)


Node Port Virtualization & Node Port ID Virtualization (NPV & NPIV)
+++++++++++++++++++++++++++++++++++++++++++++++++

- FCID is a 3 byte field with Domain ID as first byte

- Fibre Channel forwarding is based on FCID

- Domain ID is used to identify the Switch in the Fabric's SPT

- It implies that hard limit of switches per fabric is 256

- Some IDs are reserved so only 239 are usable but Qualified limit by OSMs 
   (Original Storage Manufacturer) is approx 50

- NPV fixes the Domain ID problem by removing the need for a switch to participate in Fabric Services
  
  > I.e. no FSPF, FCNS, Zoning etc

- Switches running NPV appears to the rest of the fabric as an end host I.e. a Node Port (N_Port)

- Upstream facing link on the NPV switch is called NP_Port AKA Proxy Node Port


FC Switch/NPV Core Swith (F_Port)----------(NP_Port) NPV Switch (F_Port)----------(N_Port) Initiator


- Switch upstream of NPV switch is the NPV core switch

- NPV Core switch runs NPIV

- NPIV allows multiple FLOGIs and FCID assignments on its F Port facing downstream

======================================================


NPV/NPIV Configuration
+++++++++++++++++++++++

- Enable NPV on NPV Switch (Downstream Switch)

 > feature fcoe
 > feature npv

# After enabling feature NPV,Switch would require reload. Also most of older config 
   including Data Plane will be erased

# On 5500 UP, reallocate ports as FC after first reload which would again require second reload

- Now configure NP Ports on NPV Switch

 > switchport mode np

- Configure F Ports on NPV Switch (Facing Initiator) / NPIV Switch (Facing NPV Switch)

 > switchport mode f

- ENable NPIV on the Core Swith

 > feature npiv

# sh npv flogi-table ( To check Initiators flogi on NPV Switch )

# sh npv external-interface-usage (To check F port to NP Port Mapping on NPV SW to 
   verify static pinning distribution)

- Zoning to be configured on NPIV Switch

HTH...
Deepak Arora
Evil CCIE