Thursday, August 16, 2012

Some info about OSPF

OSPF uses hello protocol


In OSPF Hello messages are sent every 10(some people tune it,make it even 2 seconds) seconds on broadcast/point to point networks and every 30 seconds on NBMA(Non Broadcast Multi Access such as Frame Relay) Networks

Hello message contains information such as

Router ID(name of the router)

Hello and Dead Timers(how often they are saying and this has to match between the neighbours)

Network Mask(subnet mask and this has to match between the neighbours)

Area ID(the area they are in and this has to match between the neighbours)

Neighbours(they have to match)

Router Priority

DR/BDR IP Adress

Authentication Password(this has to match)

Brief Intro on Link State Protocols

Link State Routing protocols


Forms different relationship rather than sending broadcasts in a periodic interval

After the exchange of initial routing table ,routers send small event based updates


Example OSPF and IS-IS

Advantages of link state protocols

Much Faster to converge

No Routing Loops

Forces you to design your network correctly


Disadvantages of Link State Routing

Takes heavy resources on routers

Requires a solid network design

Technical Complexity

Distance vector protocols and their issue of looping

Distance vector Routing Protocols send entire table at specific intervals


Distance vector protols are simple to implement but they have looping issues,count down to infinity issue

There are 5 loop prevention mechanism in Cisco Routers

1.Maximum Distances(For RIP it is 16 hops,if any network is 16 hops away it's not considered anymore,)

2.Route Poisoning(advertise that the network is down immediately,they kill the network by sending the network a maximum hop count bigger than 16 so that the maximum distance law takes the network out)


3.Triggered Updates(send the update immediately rather than waiting 30 sec like RIP generally does,poison the route,and tell the neighbour device that the network is down,triggered idea should be avoided in an unstable network where interfaces are going up and down)

4.Split Horizon(tell routers do not send updates/advertisements in the same direction you recieved them)

5.Hold Down Timer(it won't believe any other updates about a particular route for a cirtain amount of time,180 sec is typical,works great in a situation where interfaces are going up and down)

Tuesday, August 14, 2012

Playing with swap


after creating a swap partion by by Gparted tool you need to turn swapping on that partition,

swapon /dev/sdb1

swapon -s will reveal all the swap partitions

instead of free -m you need to use the free command to see the total swap and it's usage

swapon -a enables swap from /etc/fstab

we need to update the /etc/fstab to make the newly created swap partition available after reboot

in nano ctrl+k for cut and ctrl+u for uncut and by this way you can copy the existing lvm based swap line and just replace the directory,ehich in my case is /dev/sdb1

swapoff /dev/sdb1 will release the swap on the device(device and file)

swapon -a will read the /etc/fstab again and the released swap will be activated again


to create a swap from shell

fdisk /dev/sdb 


N for creating disk

T for making it swap

W for writing the partitioning table

swapon /dev/sdb1

if not succesful then try using mkswap /dev/sdb1



allocation of swap from a file

dd if=/dev/zero of=/root/swapfile bs 1024 count=524288

mkswap /root/swapfile

swapon /root/swapfile

swapon -s will show the swap

to make this parmanent modify the /etc/fstab file

it will be like

/dev/mapper/debian5-swap_1  none swap sw 0   0
/dev/sdb1                   none swap sw 0   0
/root/swapfile              swap swap defaults 0   0


swapon -a will read the /etc/fstab and show the 3 swap

swapoff -a will disable every swap in /etc/fstab

swapon -a will enable the swap in/etc/fstab