How to develop an application in ONOS app ecosystem – sample port statistics app

Tags

,

[Source : http://kspviswa.github.io/creating-an-app-ONOS.html ]

ONOS – Yet another SDN controller. This was the thought I had when I first heard about this opensource program. A lot has changed about my perception of ONOS, after getting a feel of what it is actually.

In this post, I’m going to concentrate on how to write an ONOS app.

Basics

ONOS applications are having special extension – OAR ( ONOS Application aRchive format ). The main reason for this special kind of treatment goes to one of the special reason behind using ONOS – Distributed systems .

ONOS at its heart – a distributed system. ONOS unline ODL focus more on service provider use-case. Hence HA, scalablity & resiliency has been implicit requirements for ONOS.

In distributed system, multiple ONOS nodes cater to serve a single ONOS cluster. Deploying app in .OAR format ensures that, these apps gets installed in all ONOS nodes thereby achieving consistency across the ndoes.

Below diagram gives module level view of ONOS

Getting Started

The Template Application Tutorial contains all the required content to get started. But it doesn’t offer a full working template application. In this post, let me guide you to create a working application.

Create a sample app from template

When you setup a ONOS dev environment as per this link, things will become soooo easy.

When a new developer set-out to write a SDN app in ODL, the learning curve is way too steep. Even though ONOS also follows maven archetypes , ONOS developers had made things simpler by providing a wrapper called onos-create-app.

I will let you glean-through the Template Application Tutorial to setup the skeleton app. Once you are done, continue reading through.

Scope of our application

Let us now create a simple application to get the Port Statistics of all the ports from all the devices ( possibly openflow devices ) that are attached to the controller.

So what exactly we mean about port statistics?? Well, it is basically the amount of packet, bytes that are sent to / received from a given port from a given device.

ONOS also maintain another special version of statistics known as Port Delta Statistics which actually provides the delta between 2 given probe intervals.

How to get our data from controller ?

ONOS exposes different services to poke into and get data. One such service is DeviceService. This particular service abstracts the south bound device irrespective of the south bound interface that is connected with.

So let us use this service to get the list of devices first. But before that, we need to get a reference of the interface class.

@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
 protected DeviceService deviceService;
 
  Iterable<Device> devices = deviceService.getDevices();
  List<PortStatistics> portStatisticsList = deviceService.getPortDeltaStatistics(d.id());
                for (PortDeltaStatistics portdeltastat : portStatisticsList) {
                	 if(portdeltastat != null)
                    		log.info("portdeltastat bytes recieved" + portdeltastat.bytesReceived());
                	else
                    		log.info("Unable to read portDeltaStats");
                }

While this rudimentry, why not let us monitor every port of every device in autonomous way? Sounds good right??

All we need now is a worker for us to work in independant fashion. Well the solution is TimerTask. So let us create a new class portStatsReaderTask extending TimerTask and fire an independent task operation as follows.

But before that, let us look how our portStatsReaderTask might look.

public class portStatsReaderTask {

    class Task extends TimerTask {

        public Device getDevice() {
            return device;
        }
        public DeviceService getDeviceService() {
            return deviceService;
        }
        public long getDelay() {
            return delay;
        }

        @Override
        public void run() {
            while (!isExit()) {
                log.info("####### Into run() ");
                List<PortStatistics> portStatisticsList = getDeviceService().getPortDeltaStatistics(getDevice().id());
                for (PortStatistics portStats : portStatisticsList) {
                    log.info("########## port is " + portStats.port());
                    if (portStats.port() == getPort()) {
                        log.info("Port " + port + "has recieved " + portStats.bytesReceived() + "bytes");
                        try {
                            Thread.sleep((getDelay() * 1000));
                            break;
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    }

    public void schedule() {
        this.getTimer().schedule(new Task(), 0, 1000);
    }
--snip--

Hope you get the implementation. portStatsReaderTask contains an inner class named Task that extends TimerTask. This is necessary if we want to use portStatsReaderTask as a self contained component ( you will get more clarity in the place where we really use this class ).

The run() & schedule() are really the heart & nerve of this whole logic. For the sake of this blog, I didn’t make the full source available. I shall provide a link to github source at the end of this post.

Having defined our worker, let us give some work to the worker.

activate() & deactivate function :

The AppComponent class provides activate() & deactivate() functions which marks the start & end of every ONOS app’s lifecycle. So we are going to place our logic in activate() function.

@Activate
    protected void activate() {

        log.info("Started");
        Iterable<Device> devices = deviceService.getDevices();
        
        List<PortStatistics> portStatisticsList = deviceService.getPortDeltaStatistics(d.id());
                for (PortStatistics portStats : portStatisticsList) {
                    try {
                        int port = portStats.port();
                        log.info("#### Creating object for " + port);
                        portStatsReaderTask task = new portStatsReaderTask();
                        task.setDelay(3);
                        task.setExit(false);
                        task.setLog(log);
                        task.setPort(port);
                        task.setDeviceService(deviceService);
                        task.setDevice(d);
                        map.put(port, task);
                        task.schedule();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
      }

First every device, we get List<PortStatistics> objects. And for every element in list, we prepare a map of PortStatistics with port number and spawn a new portStatsReaderTask for every element in list. Now you can understand the reason for create a wrapper as explained above.

Note : As per ONOS's openflow driver (provider/of/device/impl/OpenFlowDeviceProvider.java), the polling frequency is set to 5 seconds.

Hence you might need to understand that the B/W measurement depends on this 5 seconds polling intervals. If incase you are trying to match the B/W data with external observer data ( like iperf for example ), you might need to fix the probing interval of that observer as well to 5 seconds.

Github source

Please feel free to visit myapps page to view the complete source. Make sure you read the Read.me before attempting to use the code .

Just before saying Cya…

I hope this post would have provided you enough inputs on getting started with your ONOS app development. The idea is to provide a complete walkthrough of a simple app and I hope I did justice to that intent. Feel free to fire in any questions / comments / clarifications and I would be happy to help.

Cya!!!

How to test DHCP app in ONOS controller

Tags

,

[ Source : http://kspviswa.github.io/Using-DHCP-app-ONOS.html ]

I have been acquainted with ONOS recently and trying to get my hands dirty with all the built-in apps that are shipped with ONOS. One such app is DHCP.

Unfortunately there is no clear documentation of that can be used. Also the source code of DHCP app doesn’t contain suffecient comments either. So in this post, I will cover basics of DHCP and some aspects of how to use the DHCP app from ONOS.

Traditional DHCP usecase

In a traditional networking world, end-hosts are allocated IP addresses dynamically from a DHCP server. Typically the access switches do have a DHCP agent that talks to remote DHCP server and assign the IP address to end-hosts.

In some sophisticated switches, the DHCP server runs internally to the switch or they have a static MAC address <-> IP address in place.

Below image gives a pictorial view of use-case

[Source : Google Image search]

As you can see, the access switch / router acts as a DHCP agent / client to negotiate a dynamic IP address from a remote DHCP server.

DHCP in SDN World

In green-field SDN world, there is no concept of switches & routers. All we have is the dumb forwading elements ( FE / FB ) that either talks in openflow / NETCONF standard protocols. If we have to move the DHCP usecase in SDN world, then it is pretty obvious that DHCP intelligence should be with controller.

This is how the use-case looks if we shift the DHCP to controller

DHCP in ONOS

ONOS ships with a default DHCP application and this can be used as follows.

  • Activate DHCP app

DHCP app can be activated either via GUI or CLI. In-order to activate via CLI, fire the activate command as shown below.

onos> app activate org.onosproject.dhcp

Now you can goto Menu->Network->DHCP server to view the statistics of DHCP transactions. Obviously you won’t see anything.

  • Init DHCP app

ONOS is having a roundabout way of initializing DHCP server using JSON config object. One such sample is already available in tools/test/configs/office-dhcp.json. You can make ONOS use this test config as follows.

$ onos-netcfg <ipaddress> tools/test/configs/office-dhcp.json

You can modify the fields as per your requirements.

Unfortunately there is no northbound REST available to push the configuration. This could be area of improvement in this app.

  • Using mininet to test

Mininet by default assigns hard-coded 10.0.0.0/8 range of IP addresses to mininet hosts. So when the network comes up, the hosts would be already having IP addresses.

Still, you can dynamically assign the address via DHCP by issuing dhclient <interface> under respective hosts.

For Ex:

$ sudo mn -c # clean up
$ sudo mn --controller remote,ip=127.0.0.1 # start default n/w
mininet> h1 dhclient h1-eth0 # fire a DHCP request
mininet> h2 dhclient h2-eth0 # fire a DHCP request

You can check for new IPs that got assigned by using ifconfig under respective hosts

mininet> h1 ifconfig -a
mininet> h2 ifconfig -a
  • Statistics in ONOS DHCP app

    • Via GUI

      It is also possible to check the working log of DHCP server (i.e List of IP addresses assigned, IP address to MAC address mapping etc ) in ONOS DHCP UI segment as follows.

    • Via ONOS-CLI

      DHCP app also extends ONOS-CLI shell and exposes lot of util commands

onos> dhcp-<TAB>
dhcp-lease                    dhcp-list                     dhcp-remove-static-mapping    dhcp-set-static-mapping       
onos> dhcp-list 
MAC ID: 26:6B:8D:1B:B7:07/None -> IP ASSIGNED 10.1.11.56
onos> dhcp-lease
Lease Time: 300s
Renewal Time: 150s
Rebinding Time: 200s
onos> 
  • Mininet Python script to test

While using dhclient after network is built is a rudimentry way, it is also possible to achieve the same via python mininet script as well. Below is one such approach

#!/usr/bin/python

from mininet.net import Mininet
from mininet.node import Controller, OVSKernelSwitch, RemoteController
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.clean import Cleanup

def emptyNet():

    net = Mininet(controller=RemoteController, switch=OVSKernelSwitch)

    c1 = net.addController('c1', controller=RemoteController, ip="127.0.0.1", port=6633)

    h1 = net.addHost( 'h1', ip='10.0.1.1' )
    h2 = net.addHost( 'h2', ip='10.0.1.2' )
    h3 = net.addHost( 'h3', ip='10.0.2.1' )
    h4 = net.addHost( 'h4', ip='10.0.2.2' )


    s1 = net.addSwitch( 's1' )
    s2 = net.addSwitch( 's2' )

    s1.linkTo( h1 )
    s1.linkTo( h2 )
    s2.linkTo( h3 )
    s2.linkTo( h4 )
    s1.linkTo( s2 )

    net.build()
    c1.start()
    s1.start([c1])
    s2.start([c1])

# dhclient to get dynamic IP
    intf = net.get('h1').defaultIntf()
    intf.cmd('dhclient h1-eth0')
    intf.updateIP()
  
    CLI( net )
    s1.stop()
    s2.stop()
    net.stop()
    Cleanup()

if __name__ == '__main__':
    setLogLevel( 'info' )
    Cleanup()
    emptyNet()

Closing notes

I have started to get know a lot about ONOS. ONOS wiki is only in naive stages and there is no much information for a starter like to get going with ONOS apps. Hence I set out to write series of how to use ONOS like post to help fellow beginners like me. Watch out for more ONOS KB articles.

Cya!!!!

Does Google’s machine learning is really ‘that’ useful ?? It is…..!!!

Tags

, , ,

Today I wanna share something that I really felt awesome. Yes, Google’s machine learning. It is awesome.

After watching Google’s I/O 2016, even though I was convinced that, Google has done something tremendous in the area of Machine learning / AI , I didn’t feel it , that useful for a normal average Google Search user like me. However, now I’m totally floored by Google. I’ll explain how & why.

Google understands your search term, even in Images… Wow…

Few weeks before, I was randomly searching for a good book to get a firm grip on L2/L3 fundamentals. Though I understand the networking from a developer point of view, I felt it is very imperative to understand L2/L3 basics w.r.t configuration & management to appreciate the worthiness of SDN ( which is going to be next big thing in networking ).

After lot of research in Quora, GoodReads etc, I finally narrowed to Network Warrior by Gary A. Donahue . This is the cover of the book.

network warrior

Even-though I just browsed the book, I was not so keen on buying it and drifted to other works.

Recently I was again browsing through the same keywords, but however forgot this book name. Running though the browser history didn’t help either. Tried searching keywords like “Best Cisco book” , “Best networking fundamentals book” etc, but I couldn’t find that particular book. If you look at the cover above, you notice the dog picture in the book cover. This was the bare minimum memory I had about this book.

Remembering Sundar Pichai’s keynote address in Google I/O, I thought to play with Google Image search. Here is what I gave as search string.

search

And here is the result ( appeared in just 5th row )

network

As you can see, my search string was pretty crude. But even for such bad taste of search input, still Google was shrewd enough to understand what I would have really meant and worked.

Now that’s why, As I always Say, Google is Google 🙂

SDN + GIT = GitFlow [ SCM for Flows in SDN world ]

Tags

,

In SDN world, network is programmable. Anything that is programmable, often revised / modified / changed more often. And if multiple actors do this change, then what happens ??? Sounds like an SCM ( Software Configuration Management ) ?? Exactly 🙂

Recently I came across a research paper, wherein the authors had applied popular GIT revision control over flow management and they claim that, their approach would much benefit in case of multi-cluster / batch transactions.

Check this out :

PDF : http://yuba.stanford.edu/~srini/papers/sosr15.pdf
PPT : http://yuba.stanford.edu/~srini/papers/sosr15.pptx

Especially read the concluding remarks. Very interesting.

Although I knew / understand network is programmable, it didn’t occur to me that, the moment network becomes programmable, all the downsides of software do follow to networking world.
Nothing comes free indeed 😛

Vazhakarutheeswarar – Divine chief justice

Have you heard of the term Escalation Management ???. Well, to those who haven’t, the term Escalation  is a process used to highlight or flag certain issues within an organization, so that the appropriate personnel can respond to these situations and monitor the resolutions. Escalations occur in support centres for a variety of reasons. An escalation management system allows an organization to identify, track, monitor, and manage situations that require increased awareness and swift action.

Well, in divine system too, en escalation management is in place and as you all know, Lord Shiva, presiding supreme deity assumes the chief  justice role of divine world. We all have problems and that’s what make us think about Gods, good deeds, bad deeds etc. When we have a problem or a situation, we put an application / appeal silently, to our favourite god(s) or Ishta Deivam and wait for action to be taken. If things didn’t materialize  still, we move on to formal process of seeking assistance in form of prayers / archana / abishekam etc to a special grievance cell of divine family. These special grievance cell is customized per family  / tradition basis and that forms the basis of Kula Deivam.

Praying to Kula Deivam is a formal process, wherein we use proprietary family-oriented  prayer procedure to win the hearts of their respective family gods and get the petition resolved. In  villages, this happens via various versions of Vazhipadus.

If the situation is still not under control, we opt to speciality cell of divine system. These speciality cells are capable of solving specific problems. A good analogy is, consider some one had a fracture and they had been rushed to nearest medical facility get first aid ( Ishta Deivam ). Upon getting the first aid, the person will opt to consult his / her family doctor since the doctor would know the family case history and has historic information to treat the patient well ( Kula Deivam ). Upon diagnosis, the family doctor finds that, this fracture is best to be treated by an Orthopedist ( Speciality for bone related problems ).

Vazhakarutheeswarar temple is one such special temple. This temple is known for resolving legal disputes in amicable way. Vazhakarutheeswarar is a காரணச்சிறப்புப்பெயர் ( A name with a reason ). Vazhakku in tamil means legal dispute or legal case. Arutheeswarar means one who resolves. Or in other world, A god with problem solving ability 😛 . In this temple lord shiva assumes the post of Chief Justice of பரம் ( eternal world ), hence he is பரம்பொருள் ( definition of everything ). It is believed that, there existed a dispute/ conflict / debate between Devas & Rishies regarding some aspects of vedas and nobody could find a amicable solution. In the end, All roads leads to Mr. Wonderful ( ha ha Shark Tank effect 😛 ) and they approached Shiva. Shiva assumed the role of eternal judge and presided over the debate and finally granted the verdict. This is the Sthala Varalaru ( history behind the temple ).

Concept of Lord Shiva assuming the justice role is not something new or special or unique with just this temple. Rudam Namakam – the authentic veda which praise all aspects of Lord Shiva and instigates the shivam within ourselves, had been portraying Lord Shiva as the chief justice and as Dharma Sthabakar.

lord_shiva_judge

Lord Shiva as chief justice Credits : Google Image search

 

Shiva – last pillar of escalation channel

I’m a true believer of Lord Shiva’s supremacy. While I don’t contradict the existence of other gods in Hinduism, I always believe Shiva encapsulates each and every energy ever existed in this world. He is a true god. He is the god. As per me, A God is the one who should love every being in this world. In fact every being, good or evil both created by him. Irrespective of the way in which each & every character is portrayed, as a true god, he should be casting his blessings on everyone nonetheless of their category as per Dharma. That’s what Shiva has been doing as per  my little knowledge. One point which adds strength to my belief is the fact that, Lord Shiva has been approached both by Devas & Asuras to get their job done. As a true god, he had never discriminated between his bhaktas and always do right with respect to their commitment to him.

Lord Shiva is the most supreme power in the divine world. According to me, one cannot seek material benefit / power etc. He is everything.  C’mon guys, you cannot ask your country’s president / prime minister to solve your everyday problem. It is something like that.

When I apply the escalation management , organizational hierarchy to divine world, it is so obvious that,  Lord Shiva assumes the supreme commander / Chairman ( Board of directors ) / CEO / Customer Service – Executive Vice President role :mrgreen:  .

When a crises arises, I will first try to get it resolved through my Istha Deivam ( Ayyappan ). He is the default Go-to guy for me to get instant result. He has a template of action if my petition fulfils his pre-requisites, the job will be done. No questions asked. More about him later. For bigger reasons / issues / use-cases ( wow I’m more into management jargons nowadays 😛 ), my speciality guy is ( Perumal ). Seeking assistance from him is equivalent to getting a loan from a bank. I will have explain my commitment, my need, justifications of the need. I also should have to prove that, I’m capable & worthy of getting the benefit that I’m seeking through the petition. He is quite dangerous if he doesn’t see the worthiness in my petition. He is also known to make sharp twists & turns while performing the grant. For the most time, I wondered, God what I asked and what you are giving. Are you insane ??? This is not what I wanted. What’s your problem with me ??? And then I hear his voice in subtle C’mon… Gimme a break. You trusted me until now, Why don’t you wait little longer ?? I don’t have to explain everything to you. Just keep your mouth shut and watch me play. You will get what you want in the end. Perseverance is the key my child. Don’t forget it. Most of the time, I got what  I wanted. For some of my unreasonable demands, I also got a stern reply from him. He is the most vocal god, I had ever seen. More about him later. And there comes the last layer. Lord Shiva. For any issue, that is most life threatening, most soulful and most delicate, my petition will be automatically escalated to him. He is very silent. Speaks so little. Most of the time, he communicates through signals, sounds & symptoms. But I always have a personal attention ( or maybe I feel like this 😉 ) whenever I visit him. Seeking something from Lord Shiva is very stupid. He knows all, he is everything. He is Me, Just that, I don’t recognize it yet ( if I do, I may be a sadhu 😛 ). He is the last pillar of escalation channel.

Commitment is the key : 16 is the magic number

Process is everything. Process guarantees that, the system performs it’s duty with due diligence. System confirms that, for a given set of inputs, you have predictable outputs. When the output becomes predictable, decision making becomes easier. When decision making becomes easier, you planning will become better. Better planning leads to better control & execution. Better execution results in better performance & productivity.

Huh… enough of the management class… Please jump to 16 will you… ( I heard you thoughts.. Hold on… ). Okay. As per the relics, inorder to achieve your objectives in this temple, you have to adhere to the following.

  1. Visit the temple during Mondays, for 16 weeks continuously without a break.
  2. During every visit,
    1. Light 16 Ghee lamps ( Nei Vilakku ) and pray for your objectives.
    2. Revolve 16 times in the temple with Lord Shiva in mind.

A Divine petition

During the temple visit, one custom intrigued me. There exists a formal petition to God, where you are asked to pen-down your worries and promise that, you will perform above customs dutifully. This petition will be letter format ( from address, to address etc ). When you perform Archana, you are asked to provide this to Archakar ( one who is allowed to perform rituals to main deity on behalf of us ) and in return of prasadham, same petition will be returned back to you. This is like an acknowledgement that, the lord had received your petition and appropriate action will be taken by him considering the priority of your situation.

Some tips

  • This temple had attracted lot of celebrities right from top brass political parties to cine personality. That being said, there is no special darshan fee and you will normal citizens like you & me from local & long distance would throng the temple. Another justification for the real god. Just same for everybody.
  • Mondays will be so hectic inside the temple as the temple is quite small and under renovation. So try to be inside temple latest by 6 AM.
  • During Mondays, temple will be opened by 5 AM and darshan will get started by 5:30 AM. Other days temple will be opened by 9:30 AM.
  • I have seen people doing Abhishekams during 7:30 – 8 : 30 AM slot based on prior appointment with chief archakar. No website / special process. Just get the slot booked personally.
  • The lamps & archana products will be available inside temple itself. 16 lamps package comes for 80 Rs with complementary matchbox.
  • If you are driving on your own, you can blindly depend on Google Maps. The route is intact.

It is debatable whether going to this temple is going to really benefit legal dispute. But the bottom line is this. Visiting this temple gives you the peace of mind that, you had approached the most powerful guy in the universe. That’s the best you can do. You had dutifully done  your duty and approached the last mile of divinity. The rest will upon his will and wish. You can only record & observe. Once I have this enlightenment, entire perspective of looking at the given issue changes and  I have the free mind to Move-On.

I’m hereby soft-ending my rumblings of Lord-Shiva by quoting my fav lines of Shiva Thandava Sloka

Credits : Google Image Search

 

√2 is crazy . Find out why….

Tags

,

Back in my school days, my mathematics professor always used to praise maths as “Natural Science “. It is indeed. However during school / college days, I used to wonder why the hell I’m learning the differentiation / integration / ordinary differential equations / Fourier transforms bla bla bla.

However, after spending 7 odd years in IT career and filling by mind with arrays, structures, sockets, RPCs, observer design patters, memory leaks, core dumps, GDB, conference calls, proposals, delivery Huhhhhh   😦 I wanted to go back to my 10 std and immerse myself in trigonometry & algebra.

My friends used to mock me being a nerd as I always use to tell speed of the light is not , it is   🙂 [ Now I know, why those people called me a nerd  :p ]

Mathematics & Physics were my most sought-after subject. It still intrigues me when I see movies like A beautiful mind Apollo 13 Inter-Stellar Martian etc. Not just for sci-fi scenes ( could anyone forget Back to the future series wow… ), but for the subtle physical & mathematical facts that is buried deep inside story and dialogues.

Of all the mathematical figures, √2 is my favorite number. It is because, it a number, however it is categorized as irrational.

Irrational means, not being rational. i.e going bonkers :P. 

Well let me explain how.

Any rational number can be explained in fractional form. So let us say  √2 can be expressed as by 2 numbers p & q, such that  . But we should also remember that, P or Q should be ODD number. Because, if both P & Q are even number, then should get cancelled until, they become odd. Just think about it,   will eventually come over to . So, our first premise is this.

 √2  is a rational number expressed by  , such that P or Q is odd number.

Now let us try to prove our premise and try to add support for our argument.

First squaring on both sides, we have    or we can also say that, .

Since anything multiplied by 2 is even number, we can term that  is even. If  is even, then  should also be even, since square of an odd number is odd and square of even number is even.

Okay, now since  is even, there can be only one thing possible to prove the above premise. i.e  is ODD.  Let us try to find out, whether  is ODD or not.

Since  is even as per above statement,  can be expressed as , where  can any positive integer. Substituting in above premise, we get .

As usual, squaring on both sides, we get  . Take out the common 2 and you will get , which essentially means that even Q is an even number.

Now, if you connect the dots, you can deduce the following.

  • Any rational number, can be expressed as fraction of 2 numbers, on which one of the number should be odd.
  • In case of √2, both the numbers appears to be even, hence √2 cannot be expressed as a rational number.

Hence, √2 is irrational, crazy 😛 .

This is the fun size of maths, that I love about. This is my first post in mathematics. I suddenly realized that, I still love maths in bottom of my heart. Solving classical algebra problems, fills my mental nerves with ecstasy and I’m attaining the nirvana moment now & then :p. Looks like I will start write more about my passion in maths in future. Until then Cya 🙂

Toggling between Windows hyper-v & VirtualBox

Tags

, , ,

One of the best thing ( and probably the last thing) , that I love about Windows 8 / 8.1 is the Windows hyper-v technology, that comes bundled with OS itself. Hyper-V offers what is known as “hardware assisted virtualization” or better known as Type-1 hyper-visor.

The performance is very neat, as compared to software assisted virtualization / host OS based virtualization or better known as Type-2 hypervisor.  Oracle VirtualBox  is one of the widely preferred solution for type-2 based hypervisor. Or in other words, Safe-Sandboxed-yet-not-burning- a-hole-in-your-wallet solution :-).

I started linux based opensource work via VirtualBox and but started using hyper-V now considering its superior performance. However due to the nature of dependency I have with Virtualbox VMs, I used to toggle frequently b/w Hyper-V & VirtualBox.

One interesting ( also painful ) fact is that, both hyper-V and VitualBox cannot co-exist. That’s because hyper-V relies on hardware based virtualization ( if your hardware supports it. Most system have this setting in the BIOS screen). Hence inorder to shuttle between hyper-v and virtualbox, I wrote the following script to save some time ( or in other words, I’m lazy to  type it everytime 😛 )

To enable hyper-v [ which also disables VirtualBox ]


echo "Enabling Windows Hypervisor"
bcdedit /set hypervisorlaunchtype auto
echo "You should restart Windows now"

To disable hyper-v [ which also enabled VirtualBox ]


echo "Disabling Windows Hypervisor"
bcdedit /set hypervisorlaunchtype off
echo "You should restart Windows now"

You can also toggle the  hypervisorlaunchtype value with single script. But remember that, in-order to make an effect of this setting, you would need to restart your machine.

I am getting to know the hyper-V better nowadays. Hopefully,  I will migrate my entire lab to Hyper-V one day 🙂

 

 

Windows 10 EAP-TLS issue and the RADIUS server perspective behind it.

Tags

, , , ,

Ever since Microsoft rolled out Windows 10 and pushing all the consumers who are in Windows 7 / 8 / 8.1 to 10, there has been lot of push for several enterprise software providers to change / mend their code, just because to support MS.

One such problem is listed here : https://support.microsoft.com/en-in/kb/3121002

Windows 10 devices can’t connect to an 802.1X environment .

Symptoms

After you apply the Windows 10 November update to a device, you cannot connect to a WPA-2 Enterprise network that’s using certificates for server-side or mutual authentication (EAP TLS, PEAP, TTLS).

Cause

In the Windows 10 November update, EAP was updated to support TLS 1.2. This implies that, if the server advertises support for TLS 1.2 during TLS negotiation, TLS 1.2 will be used.

We have reports that some Radius server implementations experience a bug with TLS 1.2. In this bug scenario, EAP authentication succeeds but the MPPE Key calculation fails because an incorrect PRF (Pseudo Random Function) is used.

Simply put, during SSL handshake, MPPE keys will be derived. After initial RADIUS authentication, the supplicant should start the communication by decrypting the MPPE keys. Till TLS v1.0, this method was hard-coded to either MD5 or SHA1. However as per TLS v1.2 RFC, provision has been made to dynamically select the cipher-suite based on the client-server negotiation. However, the RFC is still confusing as in some parts it is still referring to old hard-coded methods.

Also, there is a speculation that, this confusion has been noted and things are noted to curb this confusion in upcoming TLSv1.3 draft.

The fix for this issue has been highlighted in freeRADIUS’s commit here.

The solution is use an SSL method SSL_export_keying_material to dynamically get the keying algorithm based on the negotiated ciphers.

This root-cause and the information was not readily available for the needy and here is the blog exactly for the same reason.

A wannabe entrepreneur ?? Watch SharkTank first…

Tags

Entrepreneur – A nice word to capture enthusiasm, zeal, motivation & drive to achieve something out of the box, on your own & be contended.

I too wanna be an entrepreneur . However, my notion of entrepreneurship changed drastically after watching this series – SharkTank.

SharkTank is a reality programme aired in english reality channel. Here is the plot. There will be 5 – 6 investors, sitting in centre of a meeting room, with their pockets loaded with cash. They are so much loaded such that, they can easily make a million dollar deal within seconds.

An entrepreneur / group of partners / founds / share-holders walk-in to the meeting and greet them as follows.

“Hello Sharks. My name is XXX coming from YYY and I’m the CEO of KKK company. Today, I’m seeking $$$$ dollors in exchange of 15% equity of my company”

This is how the scene actually starts. But the rate at which the scene transforms is truly mind blowing.

Most people in the “wanna be entrepreneur” category just focus on the novel idea / product / design in their thought process. Even I was under the same category until I accidentally get myself hooked up with this show. While everyone would acknowledge that, you have a unique value proposition to conduct a business,  it does not necessarily mean that, your product / service is the one.

Your product / service may be an outstanding one. But that’s just the first step. It may be the last step, if you don’t have answers to other important factors when it comes to business.

These sharks are millionaires / billionaires who started out as a normal people just like you & me and they had risen to this  level after going through lot of business hurdles. The kind of perception they bring-in to the table, simply amazing. When an entrepreneur starts outlining this idea, it might look mind-blowing , awesome, excellent. However when these sharks some fundamental questions, you will just see, right in front of your eyes that transformation that takes place in the table. You will understand what are the missing holes, how bad the business could turn around & lastly why they politely decline to invest.

What is the sales for the last 12 months ?

What is the cost of making one unit ( of the product ) and how much do you sell it for ? What is the % of margin you make per product ?

What is the projected sales numbers for current year?

If I give you the amount that you are asking, what are you going to do with it?

Do you have a patent? Why just utility patent, What about the design patent ?

Are you willing to license your product design ?

I want a royalty for every product that you sell, would you agree for it?

Do you want my money or my time ?

What is your customer acquisition cost?

How do you sell your product? Online or Retail or Wholesale ?

Answers to those questions, would make you to understand Business is not a sugar candy. Business is not engineering. Business is not just coding , developing, manufacturing, designing. It is lot more.

You don’t need to solve a problem. You don’t need to invent anything. You don’t need to redesign anything. All you need is to see an opportunity. And you just need to capitalize that opportunity.

Making money doesn’t have to do anything with intellect. I have seen lot of candidates walking-in with techy guy as a partner or friend and bag out deals worth of millions. Other category of people was either nerd or just the hard working legion of individuals, who just know to work.

One of the ground rule of SharkTank is

“Know thy numbers”.

That’s where I realized the ground reality. See almost 9 / 10 folks had / have an idea of starting their own company. It may be due to real passion or just want to get out of monotonous day to day routine job etc. But why there aren’t lot of start-ups coming out? Why only 20 – 30% start-ups really succeed in getting handful of investments. Especially when lot of support is getting together from Govt, support organizations likes MakeInIndia, Startup50, StartupSaturday etc.

The answer is simple. Business isn’t product / service. Business is Money. So when you start out to aspire for starting a company, just ask yourself,

Am I making money? Is there any opportunity for me to make money? Are there any potential  buyers? How big is the market? Am I creating a new market division or your leveraging one.

How long does it take to get back my money that I invested? Am I imitable?

As Mark Cuban ( of my fav shark ) points out,

“First there are Inventors, next there are imitators, next are the idiots “.

To simply put, if you product / service can easily imitable, then you are in grave danger.

The bottom line is Business world is totally different. You can easily become an inventor if you have the right talent. However to become an entrepreneur , it takes lot of skills.

Watching SharkTanks gave me lot of insights. It has become my fav show and I’m following all the sharks and their post simply motivates me. Hopefully, I should learn the business acumen and turn in a shark one day.

Kasu… Panam… Dhuttu… Money… Money…. 🙂 🙂

Kaasu

 

 

Trust… but Verify…

Tags

Trust, very powerful word in English. Trust gives us hope, hope gives us life and make us live.

Trust is all we do either voluntarily / involuntarily. We trust our parents, our friends, our government ( election is around the corner 😛 ). We even trust some people blindly like bus drivers, manufacturing industries etc. We even trust google / microsoft / amazon / apple and let our private data sit in their servers. Isn’t it.

Countries trust each other, humans trusts gods, lungs trust our atmosphere, we trust that there will be tomorrow.

Trust fills every ounce of this universe. Yet, there is uncertainty, absurdity, fear of aliens, fear of attacks, fear of data theft, fear of data piracy, fear of corruption, possibility of anything to become nothing and nothing to become anything.

In software industry, particularly in engineering support kind of projects, we deal with lot of ambiguity & absurdity. Same code, same platform, same set of inputs, will work in one machine, but it won’t on some other machine. To fuel more of this absurdity, the possibility of code, not working, seems to be higher in customer / end user environment, not on the developer’s or tester’s.

6d63bd23ad5e60f5a9ccbc60ed2a25a7

I was into one such absurd situation earlier. There was a field issue, pretty much escalated as a steam-engine. The ticket description, also claimed that, until they upgrade to recent patch that we delivered 2 days earlier, there was no issue. When I reviewed the commit history, there was no other commits visible. i.e Other than the recent bug fix, that we made, there was no code change, which could account for this absurd behaviour.

I was even sceptical, whether customer had “really” seen this behaviour or not 🙂 . I blindly trusted the CM tool and I argued that, if there is no commit history about any recent code change, then for sure, there is no mistake on our part. Computers don’t lie.. do they 😛 ( unless you told them to do so 😛 ).

I didn’t give up and started the “ping-pong” war with support folks. I was very adamant and  argued that, unless I “see” the problem, I’m not gonna believe it. Here, you need to understand the scenario. I work for company X, for client Y, and there is the customer Z for Y. So in Z’s conference, I represent Y’s engineering team. Since I was not ready to believe customer’s issue, after a long persuasion, end customer finally agreed for a remote session.

I was pushed into a real situation now. My manager (X) warned me that, if I confirm the issue, then the real problem is, we have to face the heat of the end customer (Z) + actual customer (Y). Now the problem has actually transformed from a regression issue to ego issue. You will be amazed to realize, how things actually change to anything from nothing.

I was now in a very confused state. To proceed with the remote session ( as I trust the CM tool ) or abort it and re-work on my analysis again ( as I have to trust the customer eventually ).

Thankfully, I had a good manager / mentor ( Y ). He was involved in the discussion from the start, and also kind of acknowledged my push for remote session ( however not supported it out rightly ). I invited him for a short talk and explained my problem. He just uttered the golden words..

“Trust… but Verify…”

This sentence, kept ringing me throughout the day. I had just 6 hrs to confirm my availability for the remote session. I had to make a decision. But.. Trust.. but verify… Trust but verify… Trust.. but verify… kept haunting my mind.

I decided to give it a try, keeping aside my ego, my 6th sense. I started to analyse the entire problem with clear state of mind, without any prejudice. So going back to basics, if there is any change in the content of the file, it would result in the md5 hash of the executable that is being produced. That being said, the hash of the executable file, which is used by customer in his set-up, has to be equal to the one that is shipped from our side. I quickly collected the executable hash from my development machine ( the exact version that used by customer) and pinged my good friend in support team, to quickly extract the hash info from the case-notes without much noise :P.

This gave the first clue. Both hash didn’t match. So clearly, customer was not using the same version of executable, that he was supposed to be using. So this looks like a clear miscommunication issue. Again… the bell rang… Trust.. but Verify… Trust… but Verify..

Ok, now Customer is using something, that was provided to him by support folks. Clearly this doesn’t align with what was built from development. This looks like a classic client server problem right..? Clients sends a request over unreliable channel ( UDP for instance ) and wait from Server to respond. When the response didn’t arrive, what are the possibilities. The packet from client, didn’t reach the server itself OR Server had processed the packet and sent the response, however it didn’t reach the client OR Server is so busy with processing the packet. It is not possible for the client to get the exact error reason. All it can assume is that, there  might be some problem with the server, so let me retry sending the packet again. Coming back to the situation in hand, there are possibilities that, development team had themselves provided the faulty version of the binary ( which in theory not possible, since the commit history is clean ).

Luckily, there is a policy of maintaining last build’s artefacts, until either a new build is scheduled or there is no space. I quickly retrieved the build log and extracted the hash of the executable. To my utter surprise, rather shock ( as I started to believe in customer now :P) the hash is same as the one used by customer. So it is quite clear that, the last build has some-how messed up with build generation.

Again, still the situation hasn’t stripped it’s absurdity. If the build script is change any code, it has to enter a commit log. It it has to enter a commit log, then it should show in the commit history. The dots aren’t still connected. But atleast there is some light now. There is a problem at my end. It is now crystal clear. It is now only minutes away from its final revelation. The hunt is ON. This provided me some confidence to move on.

Suddenly I felt really intrigued on the problem. My ego on  my belief, the fear of being confronted with end customer when he learns that, what he had claimed was actually true etc everything evaporated. To me, it looks like solving a case 😛 .

Then I carefully read through the entire build log ( ~ 3 GB text file ), line by line, target by target. The entire experience was very thrilling. Every time, when I cross the target’s log and find that everything was normal, there is a mixed feeling. If everything is al right, then my initial belief was right, but then the absurdity is still real 🙂 . If I find a problem, I might understand what had went wrong, but again, I will face the heat from lot of people 🙂 .

About after 2 hours of analysis, I found the root-cause. There goes an ancient quote, Well began is half done. In software engineering support world, we go by this quote,

“Root-Caused problem is almost resolved”

The real problem was this. During the build time (i.e the code freeze was done and the build script was now working to “cook-out” the final build ), another developer had actually checked-in a fix ( which is on the same lines of the problem that the customer had ) and had also activated a “merge” task to merge the new fix into the release, at a later point of time. However due to syntax error in the commit template, merge got scheduled to current release itself. To add more fuel, the build script had actually tried to issue a commit to central repo ( so as to be shown in commit history ), however that commit got failed since, we had freezed write permission to the repo. The code has been committed locally, but not to server. This error as classified as soft error and the build proceeded without triggering any alarms.

Huhhhh. What a costly learning 🙂 . I don’t wanna bore you more by explaining how we faced the heat, tackled the customer, gained back the confidence etc. That is a special story 😛 .

So remember… Trust…!!! but Verify…!!!. 🙂

Cya…

Create your own website, free on WordPress.com.Create your own website.
Start free