Archive

Category Archives for "CrazyRouters"

Regular Expression for Network Engineer Part-1

A regular expression is set of pattern used to define certain amount of text. An powerful  tool in any scripting language to match any pattern.

Lets have a look , how regular expression can be used in Python to solves the problem. Module “re’ is imported in python to support regular expression .

<< import re >>

[  ] – its for specifying character class, individual char or range of character can be mached .

 

  • [123] will match any of the character ‘1’,’2′,’3′
  • [1-3] will match any of the character  ‘1’,’2′,’3′
  • [a-d] will match any of the character a,b,c,d
  • [a-z] will match lowercase
  • [A-Z] will match uppercase
  • [^6] will match any character except 6
  • [a-zA-Z0-9] will match any alphanumeric character
  • [^a-zA-Z0-9] will not match any alphanumeric character
  •  [a-zA-Z0-9] is equivalent to \w
  •  [^a-zA-Z0-9] is equivalent to \W
  • [0-9] is equivalent to \d
  • [^0-9] is equivalent to \D
  • [  \t\n\r\f\v] is equivalent to \s
  • [ ^ \t\n\r\f\v] is equivalent to \S

 

. – Period character ,use for matching any single charcter

  • EXAMPLE :

 

[code language=”python”]

In [225]: ip =’10.20.30.40′
In [226]: re.search(r”.”,ip)
Out[226]:&lt;_sre.SRE_Match object; span=(0, 1), match=’1’_>
In [227]: re.search(r”.”,ip).group(0)
Out[227]: ‘1’

Continue reading

Regular Expression for Network Engineer Part-1

A regular expression is set of pattern used to define certain amount of text. An powerful  tool in any scripting language to match any pattern. Lets have a look , how regular expression can be used in Python to solves the problem. Module “re’ is imported in python to support regular expression . << import […]

MTU (Maximum Transmit Unit) and MSS (Maximum Segment Size)

What is difference  between MTU and MSS ? Most frequent question asked on the internet by networking guys.Hope this post will answer all queries related to MTU and MSS. As per Wikipedia , the maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single, network layer, transaction , that […]

SDN : APIC Vv APIC-EM

Software Defined Network (SDN) is technology to allow network devices to be managed through software application, thus making configuration process automated and faster. Network devices have its own management plane, data plane and control plane. Traditional SDN decouples Control plane from all different devices and have all these control plane go live inside  SDN controller […]

Nexus 9K –ACI Mode – PART 2

Welcome to part 2 of ACI series,  if you want to go through  part 1 of ACI series , here is link for reference  https://crazyrouters.wordpress.com/2017/05/22/nexus-9k-aci-mode-part-1/ Let’s start with the discussion of new terms related to ACI which will be used further during ACI discussion.   Above Pic tells about the different relation between Tenant and […]

Learning Python: Week3 (Conditionals and For Loops) -Part 4

As discussed in post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Week 3 (Conditionals and For Loops) .This post will focus on […]

Nexus 9K –ACI Mode – PART 1

  SDN is the Buzzword for Network Guys, How is it related to Nexus 9k in API mode. Let’s Start with SDN to understand the co–relation between SDN and Nexus 9K (ACI Mode). To understand SDN in network terms, SDN does decoupling of control plane and data Plane, thus decision making now done at centralized […]

Learning Python: Week3 (Conditionals and For Loops) -Part 3

As discussed in post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Week 3 (Conditionals and For Loops) .This post will focus on […]

Learning Python: Week3 (Conditionals and For Loops) -Part 2

As discussed in post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Week 3 (Conditionals and For Loops) .This post will focus on […]

Learning Python: Week3 (Conditionals and For Loops) -Part 1

As discussed in post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Week 3 (Conditionals and For Loops)  Exercises. As Usual , lets […]

Learning Python: Week2 (Printing, Numbers, and Lists) -Part 5

As discussed in post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Exercise 4. ################# Exercise 4 ############# IV. You have the following […]

Learning Python: Week2 (Printing, Numbers, and Lists) -Part 4

As discussed in last post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. This post will focus on Exercise 3 ########### EXERCISE 3  ######### III. You have the […]

Learning Python: Week2 (Printing, Numbers, and Lists) -Part 3

As discussed in last post,  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. Here we are going to discuss the Exercise 2 . Here is the Exercise 2 […]

Learning Python: Week2 (Printing, Numbers, and Lists) -Part 2

As discussed in last post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. Now its time to go for the exercise , already shared the notes related to […]

Learning Python: Week2 (Printing, Numbers, and Lists) -Part 1

As discussed in last post,  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. Kirk discussed about the printing ,raw_input,numbers,List and Tuple . Few of my friends asks to […]

Learning Python: Week1 (Preliminaries and Strings)

  As discussed in last post  ( https://crazyrouters.wordpress.com/2017/02/25/learning-python-kirk-byers-python-course/  ) , i will be sharing the my learning on weekly basis as course continues. This will not only motivate me but also help others who are in phase of learning python 3. Kirk discussed about the string methods in first week ,where he also put some […]

Learning Python -Kirk Byers Python Course

Learning is process and there is no end to it. I came across Kirk Byers free python series and subscribed to the same . The next Learning Python course starts on April 13th. I should receive the first class on that day. Reviews for this course is positive .Hopefully i will be able to follow the course as schedule and would share my […]

Python Functions – Basic

Python Function is a block of statements that can be used multiple times in a program. Its tedious task to use same block of statements multiple times, instead we can have function which contains same block of statement and can be called wherever there is need for the same. A function in Python is defined […]

ARP – Address Resolution Protocol

When ever Network Engineer thinks  of ARP , first thing which comes in his mind is MAC address and layer 2. MAC  Address is unique identity provided to NIC card for communication at layer 2. It’s also sometime referred as Burned-in-address or hardware Address. Every network engineer should have good understanding of ARP. ARP is […]

Python Loops – Basics

  The if, while and for statements implement traditional control flow and provide the output depending upon the condition.   IF /ELSE   An if statement consists of a  condition followed by one or more statements.An if statement can be followed by an optional else statement. Else statments is used with for loop to give […]