What is IP address "overlapping" within the context of NAT ?

network internet

IP address overlapping refers to a situation where two locations that want to interconnect are both using the same IP address scheme. This is not an unusual occurrence; it often happens when companies merge or are acquired. Without special support, the two locations will not be able to connect and establish sessions. The overlapped IP address can be a public address assigned to another company, a private address assigned to another company, or can come from the range of private addresses as defined in RFC 1918. Private IP addresses are unroutable and require NAT translations to allow connections to the outside world. The solution involves intercepting Domain Name System (DNS) name-query responses from the outside to the inside, setting up a translation for the outside address, and fixing up the DNS response before forwarding it to the inside host. A DNS server is required to be involved on both sides of the NAT device to resolve users
wanting to have connection between both networks. NAT is able to inspect and perform address translation on the contents of DNS “A” and “PTR” records, as shown in Using NAT in Overlapping Networks.

What is Service Provider PAT Port Allocation Enhancement for RTP and RTCP?

network internet

The Service Provider PAT Port Allocation Enhancement for RTP and RTCP feature ensures that for SIP, H.323, and Skinny voice calls. The port numbers used for RTP streams are even port numbers and the RTCP streams are the next subsequent odd port number. The port number is translated to a number within the range specified conforming to RFC-1889. A call with a port number within the range will result in a PAT translation to another port number within this range. Likewise, a PAT translation for a port number outside this range will not result in a translation to a number within the given range.

How to setup xdebug with Netbeans on Unbuntu

php code

xdebug is a PHP extension for debugging of php code. It supports stack and function traces, profiling information and memory allocation and script execution analysis. It uses the DBGp debugging protocol.  In this post we are going to see easy steps to install and setup it with Netbeans IDE on Ubuntu

Step 1:

Install xdebug using following command


Step 2:

Browse to your php folder and locate xdebug.so file. In my case it is /usr/lib/php5/20121212/xdebug.so. Copy this files path.

Step 3:

Open your php.ini ( /etc/php5/apache2/php.ini ) and add following lines at the end of this file

Replace zend_extension path with the path you have copied in previous step

Step 4:

Restart your apache server using

Step 5:

Open Neatbeans and goto Tools > Options > PHP > Debugging and make sure that there is Debug Port set to 9000
and Session ID to “netbeans-xdebug

Step 6:

Thats it you are almost done. Now just create a new php project, add some breakpoints to any php file in it and click on Debug Project from tool bar or press ctrl+F5. This will start debugger.


Debugging Magento Project using xdebug with Netbeans on Ubuntu

Stunning Rolls-Royce concept car 103EX

          On 16th of June Rolls-Royce announced a driver less, autonomous concept car Rolls-Royce 103EX.  It uses artificial intelligence for autonomous driving and they named this AI as Eleanor. Eleanor can give passengers information about their trip and upcoming appointments for the day.

            The car look is very attractive and it looks almost all like taken straight from a sci-fi film. The interior of car is very special, we can call it moving living room. One of  the most cool thing is it has no steering wheel as car is driving on its own. Passengers in car can sit back and watch a show on a giant OLED screen that takes up the entire wall of the front cabin. This car comes with lot more luxurious features like sleek doors that swing open when you’re ready to start your trip and secrete storage compartment. Following are some of the official videos and images of Rolls-Royce 103EX.

This slideshow requires JavaScript.

Official Website of Rolls-Royce EX103 :  http://www.rolls-royce103ex.com/vision/


How to optimize Magento website performance


Magento if the most widely used e-commerce framework. In this post I have mentioned few important points through which we can optimize overall Magento website’s performance. Most optimizations will work with any version of Magento.  Note that here I assume your customized Magento website is build by following all the recommended coding standards (For more information about Magento coding standards please visit http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html). So, following are important points/guidelines you are supposed to follow to improve Magento performance.

  • Enable Cache through Magento Admin Panel.
  • Use minified js/css and enable Merge CSS/JS through Magento Admin Panel
  • Enable code compilation after complete development. If updates, code modifications, extension installations are needed, code compilation needs to be disabled first. If not, there will be errors.
  • Set HTTP Header Field Connection : Keep-Alive through server configuration.
  • Do not take backup or place other folders in servers “/var/www/html/”  other that project’s main folder.
  • Use PNG images.
  • Apply lazy loading on images.
  • Reduce HTML source code by removing spaces, commented text and make HTML inline, this helps to render page fastly by browser.
  • Enable Flat Categories and Products: In Magento admin, (top menu) System > Configuration, (left nav) Catalog > Catalog, (main page) Frontend.  Set “Use Flat Catalog Category” and “Use Flat Catalog Product” to “Yes“. Attributes that apply to Categories and Products are stored in separate database tables depending on their datatypes. ‘Flattening’ will put all attributes in one table for Magento retrieve. This will have a positive impact on site speed especially if it has 1,000 or more products.
  • Optimize the MySQL server (enable Query Cache and tweak my.cnf parameters).
  • Enable gzip through server configuration and note that you don’t apply it on images as images are already compressed.
  • As part of database maintenance do log cleaning.
  • Use PHP Accelerators : Using a PHP accelerator is another form of caching. They increase performance of PHP scripts by caching them in their compiled state. You can use a PHP accelerator like APC, ZendOptimizer+ or Xcache.

Rules for improving web page response time :
Studies have shown that web page response time can be improved by 25% to 50% by following these rules.

Indian Government Websites Directory

Hello Readers!.. In this post I am going to provide you list of some important websites of Government of India. The official directory of all websites by Government of India is available on goidirectory.nic.in/index.php. Most of this website are made under Digital India initiative by Government of India. So following is the list of some important websites, I will be updating this list periodically.

National Portal of India ( india.gov.in ) :  National Portal of India is the Official Portal of the Government of India, designed, developed and hosted by the National Informatics Centre (NIC). This portal is a single window access to the information and services being provided by the Indian Government for citizens and other stakeholders.
National Informatics Centre (NIC) Logo (External website that opens in a new window). The content in this Portal is the result of a collaborative effort of various Indian Government Ministries and Departments, at the Central/State/District level. This Portal is Mission Mode Project under the National E-Governance Plan, designed and maintained by National Informatics Centre (NIC), DeitY, MoCIT, Government of India.

MyGov ( mygov.nic.in ) : Its a Platform for Citizen Engagement towards Good Governance in India. MyGov is an innovative platform to build a partnership between Citizens and Government, with the help of technology for growth and development of India. MyGov platform is a unique path breaking initiative which was launched on July 26, 2014 by none other than the Hon’ble Prime Minister of India, Shri Narendra Modi. It is a unique first of its kind participatory governance initiative involving the common citizen at large. The idea of MyGov brings the government closer to the common man, by the use of online platform creating an interface for healthy exchange of ideas and views. By involving the common citizen and experts with the ultimate goal to contribute to the social and economic transformation of India. In its short span of existence till date, MyGov platform has been more than successful in keeping the citizens engaged on important policy issues and governance. Be it Clean Ganga, Girl Child Education, Skill Development and Healthy India to name a few. There is no doubt that this platform has made inroads in diminishing the gap which has traditionally existed between the citizen and the government. MyGov platform has become a key part of the policy and decision making process of the country. Where the platform has been able to provide the citizens a voice in the governance process of the country. And create grounds for the citizens to become stakeholders not only in policy formulation and recommendation bit but also implementation through actionable tasks. Given the importance of this platform in transformation of India through participatory governance, the platform has been constantly undergoing upgrades to ensure an enhanced level of user experience. The major attributes of MyGov includes Discussion, Tasks, Talks, Polls and Blogs on various groups based on the diverse governance and public policy issues. Today MyGov has more than 1.78 Million users who contribute their ideas through discussions and also participate through the various earmarked tasks. In addition to this the platform gets more than 10,000 posts per weeks on various issues which are analyzed and put together as suggestions for the concerned departments who are able to transform them into actionable agenda. With these impressive numbers, one has to say this is just the beginning and there is a lot more to come on this platform in future. As mentioned by the Hon’ble Prime Minister, Shri Narendra Modi, MyGov is an initiative which should culminate into a mass movement towards self-governance or ‘surajya’. As further progress is being made under the umbrella of Digital India, utilizing the technology to further revolutionalise the public service delivery and citizen engagement. MyGov platform is all set to become a key agent for this change taking inputs from the citizens, the ultimate beneficiary and leverage their collective feedback to improve policy change and implementation.

Digital India  ( www.digitalindia.gov.in )  : Digital India is an initiative by the Department of Electronics & Information Technology, Government of India. To ensure that Government services are made available to citizens electronically by improving online infrastructure and by increasing Internet connectivity. It was launched on July 1, 2015 by Prime Minister Narendra Modi. The initiative includes plans to connect rural areas with high-speed internet networks. Digital India has three core components. These include:

  • The creation of digital infrastructure
  • Delivering services digitally
  • Digital literacy

Government Video Portal (webcast.gov.in ) : This portal provide live webcast of International and National events, President’s and Prime Minister’s speeches, 24×7 live channels. This webcast services is provided by National Informatics Centre, DIT, Govt. of India.

Open Government Platform (OGPL)  : OGPL is a joint product from India and United States to promote transparency and greater citizen engagement by making more government data, documents, tools and processes publicly available. OGPL will be available, as an open source platform. By making this available in useful machine-readable formats it allows developers, analysts, media & academia to develop new applications and insights that will help give citizens more information for better decisions. In using an open source method of development, the OGPL community will provide future technology enhancements, open government solutions, and community-based technical support. OGPL has become an example of a new era of diplomatic collaborations that benefit the global community that promote government transparency, citizen-focused applications, and enrich humanity. Initially, OGPL will provide governments the ability to:

  • Publish government data, documents,  apps, tools & services  from multiple departments within a government
  • Build on Web 2.0 open-source technologies with  low-cost scalable infrastructure
  • Engage Citizens  in their open data initiatives for better understanding of  their  needs
  • Provide publicly available application programming interfaces (APIs) and other tools to add external software modules for data visualization, wizards, and other purposes
  • Create data-rich community spaces around topics of national priorities and international interest
  • Empower end-users to share datasets via social media platforms such as Facebook, LinkedIn, and TwitterOGPL product has following four main components:
  • OGPL Web site – Module for Governments and their agencies to publish datasets, documents, services, tools and applications collected by them for public use.
  • Data Management System (DMS) – Module for user management of various agencies who can upload datasets which will be available on the front end website.
  • Content Management System (CMS) – Module for managing and updating various functionalities of the OGPL frontend.
  • Visitor Relationship Management (VRM) – Module for collating and disseminating viewer feedback on various datasets.

Open Government Data Platform (OGD) India : It’s a Single-point of access to resources (Datasets/Apps) in open format published by Ministries/Departments/Organizations of Government of India, Open Data Events, Visualizations on datasets etc. Open Government Data (OGD) Platform India is a platform for supporting Open Data initiative of Government of India. The portal is intended to be used by Government of India Ministries/ Departments their organizations to publish datasets, documents, services, tools and applications collected by them for public use. It intends to increase transparency in the functioning of Government and also open avenues for many more innovative uses of Government Data to give different perspective. The base Open Government Data Platform India is a joint initiative of Government of India and US Government. Open Government Data Platform India is also packaged as a product and made available in open source for implementation by countries globally. The entire product is available for download at the Open Source Code Sharing Platform “GitHub”. Open Government Data Platform India has 4 (four) major modules, as detailed below, implemented on a single Drupal instance – An Open Source based Content Framework Solution

  • Data Management System (DMS) – Module for contributing data catalogs by various government agencies for making those available on the front end website after a due approval process through a defined workflow.
  • Content Management System (CMS) – Module for managing and updating various functionalities and content types of the Open Government Data Platform India Platform.
  • Visitor Relationship Management (VRM) – Module for collating and disseminating viewer feedback on various data catalogs.
  • Communities – Module for community users to interact and share their zeal and views with others, who share common interests as that of theirs.

DigiLocker ( digilocker.gov.in ) : DigiLocker is a key initiative under Digital India, the Indian Government’s flagship program aimed at transforming India into a digitally empowered society and knowledge economy. DigiLocker ties into Digital India’s visions areas of providing citizens a shareable private space on a public cloud and making all documents / certificates available on this cloud. Targeted at the idea of paperless governance, DigiLocker is a platform for issuance and verification of documents & certificates in a digital way, thus eliminating the use of physical documents. Indian citizens who sign up for a DigiLocker account get a dedicated cloud storage space that is linked to their Aadhaar (UIDAI) number. Organizations that are registered with Digital Locker can push electronic copies of documents and certificates (e.g. driving license, Voter ID, School certificates) directly into citizens lockers. Citizens can also upload scanned copies of their legacy documents in their accounts. These legacy documents can be electronically signed using the eSign facility.
The platform has the following benefits:

  • Citizens can access their digital documents anytime, anywhere and share it online. This is convenient and time saving.
  • It reduces the administrative overhead of Government departments by minimizing the use of paper.
  • Digital Locker makes it easier to validate the authenticity of documents as they are issued directly by the registered issuers.
  • Self-uploaded documents can be digitally signed using the eSign facility (which is similar to the process of self-attestation).

National Voter’s Service Portal ( www.nvsp.in ) : This is portal by Election Commission of India, which provides various facilities to votors in indian teritory. This facilities includes

  • Searching your name in electoral roll
  • Locate Polling Station on Map
  • Apply for enrollment and correction of Election Cards
  • Know both Level Officer and Electoral Officers Roles
  • Know information about EVM (Electronic Voting Machine) and whole polling process

MyLGP ( mylpg.in ) : This portal is specially designed for LGP customers in India. Through this portal one can give up his/her LPG subsidy, get details about various subsidies provided by Indian Government on LPG and Safety Tips etc.

Press Information Bureau Government of India ( pib.nic.in ) : If you belong to Media Sector then this is the important portal for you. This is the official website of Press information Bureau of Government of India. Here you can get Press Releases, Photos, Features, Webcasting, Video, Invitations  and other information released by Government of India.

The Indian Government Tenders Information System ( tenders.gov.in ) : If you run a company/organization and looking for government tenders then it is the most important website for you. Here one can get all Indian Government tenders at one point. This Indian Government Tenders Information System is the Central Source for Government and Public Sector Procurement / Tenders/ Notifications issued by the Central and State Governments and other public bodies across India for goods, services and works.

RTI Online ( rtionline.gov.in ) : This is a portal to file RTI applications/first appeals online along with payment gateway. Payment can be made through internet banking of SBI & its associate banks, debit/credit cards of Master/Visa and RuPay cards. Through this portal, RTI applications/first appeals can be filed by Indian Citizens for all Ministries/Departments and few other Public Authorities of Central Government. RTI applications/first appeals should not be filed for other Public authorities under Central/State Govt. through this portal.

Passport Seva ( passportindia.gov.in ) : The Passport Seva Project (PSP) is transforming passport and related services in India to provide a best-in-class experience to Indian citizens. PSP is enabling MEA (Ministery of External Affairs) to deliver passport services in a reliable, convenient and transparent manner, within defined service levels. Through this website you can submit passport application and seek an appointment on payment of passport fees online. The portal provides comprehensive and latest information on all passport related services The PSP network connects with the State Police across all the states and union territories. The applicant’s data is sent electronically for police verification. PSP also provides an interface to India Post for tracking delivery of passport to citizens.
UIDAI – Unique Identification Authority of India   ( uidai.gov.in ) : Here you will get everything about Adhar Card. You can generate E-Adhar Card, track your adhar card application, update your information on Adhar Card and much more.

National Informatics Centre ( www.nic.in )  : The National Informatics Centre (NIC)  is the premier science & technology organisation of India’s Union Government in informatics services and information-and-communication- technology (ICT) applications. The NIC is a part of the Indian Ministry of Communications and Information Technology’s Department of Electronics & Information Technology. It has played a pivotal role in steering e-governance applications in the governmental departments at national, state and district levels, enabling the improvement in, and a wider transparency of, government services. Almost all Indian-government websites are developed / managed by NIC. The NIC offers a host of services including:

  • Computer-aided design (CAD)
  • digital-signature certification
  • geographical-information system (GIS)
  • domain-name registration for gov.in and nic.in
  • Informatics
    Biomedical informatics
    Patent informatics
    Rural informatics
    Agriculture informatics, including hydrography
  • internet data centre (IDC)
  • mathematical modelling and simulation
  • Computer networking
  • office-procedure automation (OPA)
  • Training
    Cyber Security
    Website hosting & website development
    Internet Services

Li-Fi a new communication technology like Wi-Fi

Li-Fi looks to be yet another disruptive technology, this time in communication, which has remained with the same wireless technology since the year 2000. Li-Fi (Light Fidelity) is a bidirectional, high speed and fully networked wireless communication technology similar to Wi-Fi. Coined by Prof. Harald Haas, Li-Fi is a subset of optical wireless communications (OWC) and can be a complement to RF communication (Wi-Fi or Cellular network), or a replacement in contexts of data broadcasting. More details are available on Lifi Wikipedia Page.

Lifi TED Talk

Chrome Dev Summit 2015 Live

Watch day one of the 2015 Chrome Dev Summit live stream! Hear from Chrome engineers on the future of the web; day one is focused on Progressive web apps. Learn how to build fast, resilient, app like experiences for the mobile web from Chrome engineers. Take away tips for smooth and fast loading, reliable access on flaky networks and for re-engaging with users. All sessions are available for on-demand streaming

Details of Schedule is Available Here : https://developer.chrome.com/devsummit/schedule

Day 1

Day 2 is focused on diving deep into RAIL, Performance and Developer tools.

How Can Many Users Share the Same Port ( TCP / HTTP Listening )

network internet

So, what happens when a server listen for incoming connections on a TCP port? For example, let’s say you have a web-server on port 80. Let’s assume that your computer has the public IP address of and the person that tries to connect to you has IP address This person can connect to you by opening a TCP socket to Simple enough.
Intuitively (and wrongly), most people assume that it looks something like this:
Local Computer  |  Remote Computer
<local_ip>:80     |  <foreign_ip>:80
🙁  not actually what happens, but this is the conceptual model a lot of people have in mind.
This is intuitive, because from the standpoint of the client, he has an IP address, and connects to a server at IP:PORT. Since the client connects to port 80, then his port must be 80 too? This is a sensible thing to think, but actually not what happens. If that were to be correct, we could only serve one user per foreign IP address. Once a remote computer connects, then he would hog the port 80 to port 80 connection, and no one else could connect.
Three things must be understood:
1. On a server, a process is listening on a port. Once it gets a connection, it hands it off to another thread. The communication never hogs the listening port.
2. Connections are uniquely identified by the OS by the following 5-tuple: (local-IP, local-port, remote-IP, remote-port, protocol). If any element in the tuple is different, then this is a completely independent connection.
3.  When a client connects to a server, it picks a random, unused high-order source port. This way, a single client can have up to ~64k connections to the server for the same destination port.
So, this is really what gets created when a client connects to a server:
Local Computer   | Remote Computer               | Role
—————————————————————————–            | <none>                                   | LISTENING         |<random_port>    | ESTABLISHED
Looking at What Actually Happens
First, let’s use netstat to see what is happening on this computer. We will use port 500 instead of 80 (because a whole bunch of stuff is happening on port 80 as it is a common port, but functionally it does not make a difference).
netstat -atnp | grep -i “:500 “
As expected, the output is blank. Now let’s start a web server:
sudo python3 -m http.server 500
Now, here is the output of running netstat again:
Proto  Recv-Q  Send-Q    Local Address           Foreign Address         State
tcp         0              0         *               LISTEN
So now there is one process that is actively listening (State: LISTEN) on port 500. The local address is, which is code for “listening for all”. An easy mistake to make is to listen on port, which will only accept connections from the current computer. So this is not a connection, this just means that a process requested to bind() to port IP, and that process is responsible for handling all connections to that port. This hints to the limitation that there can only be one process per computer listening on a port (there are ways to get around that using multiplexing, but this is a much more complicated topic). If a web-server is listening on port 80, it cannot share that port with other web-servers.
So now, let’s connect a user to our machine:
quicknet -m tcp -t localhost:500 -p Test payload.
This is a simple script (https://github.com/grokit/quickweb) that opens a TCP socket, sends the payload (“Test payload.” in this case), waits a few seconds and disconnects. Doing netstat again while this is happening displays the following:
Proto  Recv-Q  Send-Q    Local Address           Foreign Address                   State
tcp        0               0          *                        LISTEN      –
tcp        0                0        ESTABLISHED –
If you connect with another client and do netstat again, you will see the following:
Proto  Recv-Q   Send-Q        Local Address           Foreign Address                    State
tcp         0                0                *                        LISTEN      –
tcp         0                0             ESTABLISHED –
… that is, the client used another random port for the connection. So there is never confusion between the IP addresses.
Theoretically, yes. Practice, not. Most kernels (incl. linux) doesn’t allow you a second bind() to an already allocated port. It weren’t a really big patch to make this allowed.
Because you are working on an application server, it will be able to do that.