<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Bilal on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Bilal on Medium]]></description>
        <link>https://medium.com/@muhammad.bilal3967?source=rss-5e287e490344------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HIX8Jc6wgjFia7n2fVcVpg.jpeg</url>
            <title>Stories by Muhammad Bilal on Medium</title>
            <link>https://medium.com/@muhammad.bilal3967?source=rss-5e287e490344------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:03:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammad.bilal3967/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Comparing and Clustering the Neighborhoods of New York City and Toronto]]></title>
            <link>https://medium.com/@muhammad.bilal3967/comparing-and-clustering-the-neighborhoods-of-new-york-city-and-toronto-c6d68d7a0368?source=rss-5e287e490344------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6d68d7a0368</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Muhammad Bilal]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 20:46:25 GMT</pubDate>
            <atom:updated>2020-09-28T20:46:25.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/548/0*Qaq1-jtGzvT6Vxa8" /></figure><p>In this blog, we will compare, cluster, and analyze the neighborhoods of New York City which is located in the United States of America and Toronto which is located in Canada. We will investigate what kinds of businesses are common and rare in each city, what kinds of businesses are more common in one of the two cities than the other city.</p><p>Doing this task will empower us to improve comprehension of likenesses and contrasts between the two urban areas which will make it known to financial specialists what sorts of organizations are bound to flourish in the two urban areas, what are the neighborhoods that are appropriate for each kind of business, and what kinds of organizations are not entirely attractive in every city. This permits financial specialists to take better and more successful choices with respect to where to start their businesses.</p><p>New York City (NYC) is one of the most crowded urban areas in the US of America. Additionally, NYC is the most etymologically different city on the planet: more than 800 dialects are spoken in it. Additionally, NYC assumes a fundamental part in the financial matters of the USA: if New York City were a sovereign state, it would have the twelfth most elevated Gross domestic product on the planet. New York City comprises five districts: Brooklyn, Staten Island, Manhattan, The Bronx, and Queens.</p><p>The second city of enthusiasm for this task is Toronto. As with New York City in the USA, Toronto is the most crowded city in Canada. It’s perceived as one of the most multicultural and cosmopolitan urban communities on the planet. Toronto additionally is an exceptionally differing city: more than 160 dialects are spoken in it. On the monetary side, Toronto is a worldwide community for business and account and it is viewed as the budgetary capital of Canada.</p><h3><strong>Data Acquisition and Preprocessing</strong></h3><p>In this part, the processes of obtaining, cleaning, and setting up each dataset utilized in this venture for next stages will be specified. To complete this project, two types of datasets are needed, Neighborhood and Venues data. Neighborhood dataset includes the names of the neighborhoods of NYC and Toronto and their latitude and longitude coordinates. We have a portion of this information given by the facilitators of “IBM Data Science Professional Certificate” and we additionally need to scratch some information from the web. Venues dataset describes the top 100 venues (bars, parks, restaurants, museums, etc.) in each neighborhood of the two cities. This dataset will be retrieved from Foursquare API which is one of the world largest sources of location and venue data. Then it will be preprocessed so that it should list the venues of each neighborhood with their categories.</p><h4>New York City</h4><p>We need to acquire and preprocess the dataset that specifies the neighborhood data for New York City along with its coordinates and some other data, This data is extracted from <a href="https://github.com/mbilal3967/Coursera_Capstone/blob/master/newyork_data.json">JSON file</a>.</p><p>Then we can draw a map using <strong>Folium</strong> Python package of NYC and its neighborhoods, as we have their coordinates. Figure 1 shows the resulting map in which each blue circle represents the location of one neighborhood in New York City.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tXbuIK43ITlNZNXF" /><figcaption>Figure 1: Map of New York City and its neighborhoods</figcaption></figure><p>To get the neighborhood and borough data for Toronto city we will parse the Wikipedia page with <a href="https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M">url</a> . It lists the postal codes with the neighborhood and borough name associated with each postal code. We can use Pandas read_html() functions to download this web page and extract the relevant data from it. Figure below shows the first few rows of the dataframe extracted from this web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*Tc1vlw3vQLtVQq2B" /><figcaption>Figure 2: Postal codes of Toronto City with neighborhoods and boroughs</figcaption></figure><p>A dataset that maps Toronto postal codes to latitude and longitude coordinates was provided by the facilitators of “IBM Data Science Professional Certificate” course. The csv file for this data is available at “<a href="https://cocl.us/Geospatial_data">https://cocl.us/Geospatial_data</a>”. In figure below this dataset is shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*2Elz0PZOhox4fbgt" /><figcaption>Figure 3: Postal codes of Toronto City with their coordinates</figcaption></figure><p>Now by merging the both dataframes and performing the cleaning processes, the desired dataframe that contains neighborhood names and coordinates is formed, as shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*DhIgE3xofI5Vq1Cu" /><figcaption>Figure 4: Neighborhood dataframe for Toronto City</figcaption></figure><p>Then we can plot a map of Toronto city and its neighborhoods; each circle represents the location of one neighborhood or a group of neighborhoods that share the same coordinates, as shown in figure below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*EMRG27mIGnZ4XACa" /><figcaption>Figure 5: A map of neighborhoods of Toronto City</figcaption></figure><h4>Venues Dataset</h4><p>Venues data will be retrieved from Foursquare which is a popular source for getting location and venue data. Foursquare API service will be used to access and download venues data. To retrieve data a URL should be prepared, which inturn is used to request data related to a specific location. For preparing url we need the CLIENT_ID, CLIENT_SECRET and VERSION, you can get those by creating the account on Foursquare website. You can also set the RADIUS and LIMIT of the nearby venues. In this project we are using LIMIT=100 and RADIUS=500.</p><p>The first five rows of the resulting dataframe of New York City are shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*kctILBLqYLDcrS9f" /><figcaption>Figure 6: Venue dataframe for New York City</figcaption></figure><h3>Data Analysis</h3><h4><strong>Common Venue Categories</strong></h4><p>We can find the most common categories by counting the number of venue categories for each city. Figure below includes 10 most common categories of Toronto and New York City.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*8A9pxaf90PwoTlDb" /><figcaption>Figure 7: Common Venues for New York City</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*HSwEVAAxyS2x7Xrk" /><figcaption>Figure 8: Common Venues for Toronto City</figcaption></figure><p>We can see that the most common categories for New York city are Pizza place, Italian Restaurant, Cafe and Parks whereas the most common categories for Toronto city are Coffee shops, Cafe and Restaurants.</p><h4>Top 10 Widespread Venue Categories</h4><p>Now someone might be interested to know the most widespread categories in Both cities i.e. the venue categories which exist in most neighborhoods of the city. To compute this we need to count those categories which exist in more neighborhoods of the city. To present this useful information we have used the horizontal bar plots for showing the Categories and on the x-axis we have the Number of Venues, as shown in below Figures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*5KFAy3SEF6JvUkHJ" /><figcaption>Figure 9: Most widespread venue categories for New York city</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*H_px_hIsJJkPXG93" /><figcaption>Figure 10: Most widespread venue categories in Toronto city</figcaption></figure><h4>Methodology and <strong>Clustering</strong></h4><p>In this part, clustering will be applied on Toronto and New York City neighborhoods to discover comparative neighborhoods in the two urban areas. Clustering is the process of finding similar items in a dataset based on the characteristics of items in the dataset. We have used the <strong>K-mean clustering methods</strong> of the <strong>Scikit-learn Python library</strong> and form a 5 clusters of the Toronto and New York city of Neighborhoods usings the nearby venues data. For clustering we needed to convert the previous dataset to a desired dataframe using the technique of one hot encoding. Figures below show the resulting data frame, after applying the one-hot encoding on the New York and Toronto Dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*lhMEBwOKzXlBfbed" /><figcaption>Figure 11: one hot encoding on Newyork data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/0*xnfQBQYjKXoGwcyc" /><figcaption>Figure 12: one hot encoding on Toronto data</figcaption></figure><p>The next step is to take the mean of frequency of occurrence of every category after grouping them by neighborhoods. This will transform the data frame as shown in below figures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/0*l3RoU-zzMYrelQPT" /><figcaption>Figure 13: Average or mean datafame of New York City</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*TOqj-SJFPimMzWFp" /><figcaption>Figure 14: Average or mean datafame of Toronto City</figcaption></figure><p>Below figures shows the map of both cities alongs with neighborhoods clustered into 5 categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zs9m4Nt0ecqikauC" /><figcaption>Figure 15: Clusters of New York City neighborhoods</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*6kY0Bgpp2pwkn0hq" /><figcaption>Figure 16: Clusters of Toronto City neighborhoods</figcaption></figure><h4><strong>Toronto and New York City dataset combined</strong></h4><p>After making clusters of individual cities, then we combined the dataframe of both cities to get more insights, as shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*I0r1IXqhtuNdSGzI" /><figcaption>Figure 17: Combined Dataframe of Toronto and New York City</figcaption></figure><p>Then make clusters from new combined dataframe and output of the clustering operation is 5 clusters with cluster labels 0, 1, 2, 3, and 4. Each cluster is expected to contain a group of similar neighborhoods based on the categories of the venues in each neighborhood.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OXSpNLbn_AKUrHa_" /><figcaption>Figure 18: Clusters and most common categories of neighborhoods of both Cities</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*l8lkzHdBA7X8BDLj" /><figcaption>Figure 19: Data included in 4th cluster</figcaption></figure><p>In the figure above we can see how similar are the neighborhoods of 2 cities i.e. Both Bulter Manor and Emery have the baseball field, Yoga Studio and Entertainment Service as the most common Venue categories in New York and Toronto respectively.</p><p>In the figure below we have tried to get the insight of clusters by plotting the bar graph between the number of neighbourhoods and clusters on the x axis. Also in the graph below blue bars are representing the New York City and orange bars are representing Toronto City.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*G_zMFfYw089bw3V4" /><figcaption>Figure 20: Neighborhoods of both Cities in each cluster</figcaption></figure><h3><strong>Conclusions</strong></h3><p>In this project, the areas of New York City and Toronto were clustered into various groups dependent on the classifications (kinds) of the venues in these areas. The outcomes demonstrated that there are venue categories that are more common in certain groups than the others; Also these most common venue categories contrast from one cluster to the next. So using this information one can make decisions and be able to find similar neighborhoods in the new City. It will also help business people to get answers to questions like what types of businesses are more likely to thrive in both cities, what are the neighborhoods that are suitable for each type of business, and what types of businesses are not very desirable in each city. This allows business people to take better and more effective decisions regarding where to open their businesses.. In the future if a more profound investigation is performed considering more viewpoints, it may bring about finding various styles in each cluster dependent on the most common categories in the cluster.</p><p>If you want to see the code or further details of project, please have look at <a href="https://github.com/mbilal3967/Coursera_Capstone/blob/master/Report.pdf">Report</a> and <a href="https://github.com/mbilal3967/Coursera_Capstone/blob/master/Notebook.ipynb">Notebook</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6d68d7a0368" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up Virtual Machines for DPDK]]></title>
            <link>https://medium.com/emumba/setting-up-virtual-machines-for-dpdk-da1b49a9bf5f?source=rss-5e287e490344------2</link>
            <guid isPermaLink="false">https://medium.com/p/da1b49a9bf5f</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[low-latency]]></category>
            <category><![CDATA[dpdk]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <dc:creator><![CDATA[Muhammad Bilal]]></dc:creator>
            <pubDate>Tue, 28 Jul 2020 13:21:32 GMT</pubDate>
            <atom:updated>2020-07-28T13:21:32.222Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Virtual Machine</strong> is a solution designed to provide all of the functionality of a physical computer in a totally software-based (virtual) environment.</p><p>Virtual machines have a lot of advantages including:</p><ul><li>Multiple operating system environments can exist simultaneously on the same machine, isolated from each other;</li><li>VM can offer an instruction set architecture that differs from host machine;</li></ul><p>There are a lot of reasons why someone might want to use Intel <strong>DPDK</strong>. Generally, it enables us to build applications, that we can use to process packets faster! This is done by enabling packets to follow ‘<em>fastpath’(Kernel Bypass)</em> instead of normal route of Network layers and Context switching. For more details, visit <a href="https://www.dpdk.org/">dpdk website</a>.</p><p>There are many network interface cards which are supported by DPDK, and most of them are quite expensive. So its quite useful to have a option to develop and run DPDK applications without any physical constrains. Running DPDK in virtual machines allow anyone to play with it and to overcome any physical constrains.</p><p>In this article we are going to see, how to install Ubuntu 20.04 LTS on Virtual box and setup it for DPDK. After that we will setup the internal network connection on virtual machines by configuring the DHCP server on host machine. In last we are going to see the connectivity of internal connection between two VM’s.</p><h3>Installing Ubuntu 20.04 LTS on Virtual Box</h3><p>1. Download Oracle VirtualBox from the official <a href="https://www.virtualbox.org/wiki/Downloads">website</a> or you can download it using your Ubuntu app store.</p><p>2. Download the latest Ubuntu Image file from its official <a href="https://ubuntu.com/download/desktop">website</a>.</p><p>3. Open Oracle Virtual Box and click on <strong>“New” </strong>at the top bar<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*mad0vlzl53ZLwIoEhYdN3g.png" /></figure><p>4. Enter the Name for your VM. Then select <em>Type </em>as <strong>Linux</strong> and <em>Version </em>as <strong>Ubuntu (64-bit)</strong>. Then click “Next”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*a4BDSK_02hezrY_VISrokA.png" /></figure><p>5. Allocate <strong>RAM </strong>as per your usage. <em>(2GB is the recommended RAM for running DPDK).</em> Then click “Next”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*FGPGFQwlJ81-igIFJKMGVw.png" /></figure><p>6. Select <strong>“Create a virtual hard disk now”</strong> if you are installing Ubuntu on Virtual Box for the first time. Then click “Next”. Also you can use the existing virtual hard disk file of your previous VM’s (if you have created VM’s previously).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*4qxjollLSG2MBTCsvX0dmg.png" /></figure><p>7. Select <strong>“VDI (Virtual Box Disk Image)”</strong> as the type for your Virtual Hard Disk file. Then click “Next”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*reQQNnrmqrC_BlM0m2SnYw.png" /></figure><p>8. Select <strong>“Dynamically Allocated”</strong> as you may not want to keep restriction on the virtual hard disk file size (A dynamically allocated hard disk file will only use space on your physical hard disk as it fills up). Then click “Next”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*JIUeGEAKr52UqwwBlSS3Dg.png" /></figure><p>9. Enter the <strong>name(</strong>If you want to have other then default<strong>) </strong>and <strong>Size </strong>for the <strong>Virtual Hard Disk file.</strong> <em>(30GB is the recommended RAM for running DPDK).</em> Then click “Create”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*0VnUXHDl0J5pimgP6hTToQ.png" /></figure><p>10. Your VM will now be created with the above configuration. (Visible on the left panel of Virtual Box).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*bk_lmXwS-BeT_M8DWQnqkg.png" /></figure><p>11. Select the VM and click on <strong>“Start”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Vt-Qy39bBSP2zAibOxxSEA.png" /></figure><p>12. Now click on the browse icon, as pointed by the cursor below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*A9UQNsIynaOxfcGetAuKWA.png" /></figure><p>13. Now click on the “Add” icon, as pointed by the cursor below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*eimodTU8fJtSMWzD9OS1mw.png" /></figure><p>14. Go to the path of your <strong><em>Ubuntu .iso</em></strong><em> </em>image(Which you download in step 2) and select it. Then click on <strong>“Open”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*yZjUROKDMs0UwkmSrYOBoA.png" /></figure><p>15. Next, select the your <strong><em>Ubuntu .iso </em></strong>image and click on “Choose”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*FaGoNvSrExcsjr-SpNxibQ.png" /></figure><p>16. Now, click on the “Start”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*tog5uULEWqX4Rq-w-hnueA.png" /></figure><p>17. Ubuntu 20.04 will boot up and ask for Installation details. Select your language and click on <strong>“</strong>Install Ubuntu<strong>”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*9BiUrV3iZjlKwKF1fVccIA.png" /></figure><p>18. Now select your keyboard layout. i.e. <strong>“</strong>English (US)<strong>”. </strong>Then click on “Continue”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*xzNs37kYV9fcwmqT1FchPQ.png" /></figure><p>19. You can select Minimal Installation If you only require basic utilities and also uncheck the other options(if you don’t want to update now, to save time). Then click on “Continue”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*3RL2B-VW_fN8le4kyrYDYA.png" /></figure><p>20. Here you should select the 1st option <strong>“</strong>Erase disk and install Ubuntu<strong>”</strong> As you just created the new Ubuntu VM. Then click on “Install Now”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*tiIrljZaDiIkZfOBgTvC7A.png" /></figure><p>21. Click on “Continue”, if asked for “Write the changes to disk?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*RqP2QkgqQkCbziD_DMlhwA.png" /></figure><p>22. Then select your location for the time zone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*fneLeHJFFF9QztJFmSIM2A.png" /></figure><p>23. Now it’s time to choose the name, username and password. Click on “Continue”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*gevpQRzL0qVXi0a94tZGhg.png" /></figure><p>24. Wait for installation to be completed. It may take some time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*75KtW0fBVHBP1zGd52u2tA.png" /></figure><p>25. Then click on “Restart Now”. In order to use the newly installed Ubuntu 20.04</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*AKeDEZlgXBtxly7N0wStsQ.png" /></figure><p>26. Now click on Devices→Optical Drives, then check the Ubuntu.iso file by selecting it and then click the “Remove disk from virtual drive”, as pointed below by cursor. ( Sometime this is removed automatically on VM’s restart)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*PYGEbPYo4T5PR2B-Gg73gQ.png" /></figure><p>27. Next, click on “Force Unmount” and then press Enter. If login window still does not appear, just restart the Machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*JWjo1eLcgsfpoQC05R07ZQ.png" /></figure><p>28. Enter your password to login into the Ubuntu 20.04</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*HZrfeE2wA_WpuwEEeqZhfw.png" /></figure><h3>Cloning Virtual Machines</h3><p>We need two VM’s for running and testing DPDK application. To create a second VM with the same operating system and specifications, we can clone the previously created VM, by doing following steps.</p><p>1. Shutdown/Power Off the 1st VM, created previously. First click on cross, on right top, and then click on “OK” after selecting “Power off the machine”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*obX7PiZYzbUrx9wZmb38oQ.png" /></figure><p>2. Now go to the Virtual Box and After right clicking on your VM(on the left panel), select <strong>clone</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1NU5EZxwcAKyWRt98SXSA.png" /></figure><p>3. After Entering Name, click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iRfPK6g1EN3aSciXqaCuA.png" /></figure><p>4. Make sure, Full clone is selected and then click on Clone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8zB-6VowucCOeTJGu24BQ.png" /></figure><p>5. Cloning may take some time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiLNJv66tL8KTPw-hJzAsg.png" /></figure><p>6. After cloning is completed, new VM will be created with same specifications and credentials(Password will be same, as of your previous VM)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CmpTIZlM3ukYYsPDucdLeA.png" /></figure><h3>Using Internet in Virtual Machines</h3><p>By default Virtual Machine is connected to your host system’s internet. If facing some issues, go through the following steps.</p><ul><li>Turn <strong>OFF </strong>your virtual Machine.</li><li>Right click on VM and Select <strong>Settings.</strong></li><li>Now click on the Network tab from the left panel.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*zIf431sTziUJmpRwXPePBQ.png" /></figure><ul><li>Then make sure <strong>NAT</strong> is selected(in Attached to:) and then click on <strong>Advanced </strong>and make sure <strong>cable connected</strong> is enabled.</li><li>Now <strong>start</strong> your machine, Your Internet will be working in VM.</li></ul><p>Network Address Translation (NAT) is the default mode for new vm’s and works great in most situations when the guest is used as a “client” type. Guest VM’s sit on their own private LAN, VirtualBox acts as a DHCP Server and VirtualBox NAT engine translates addresses. Destination servers can see the traffic originating from VirtualBox host, no configuration needed on host or guest and it works great when guests are clients. It can’t be used for cases where guest VM’s act as servers.</p><p>Also we can’t communicate between two guest virtual machines using NAT connection. Configuration looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*fmT0OLuYKTr5MZNE" /><figcaption>Reference: oracle.com</figcaption></figure><h3>Internal Network between Virtual Machines</h3><p>When you configure one or more VM’s to sit on an Internal network, VirtualBox ensures that all traffic on that network stays within the host and is only visible to VM’s on that virtual network. Configuration looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*mrQPUETi_QNj83r0" /><figcaption>Reference: oracle.com</figcaption></figure><p>The internal network is a totally isolated network and so is very “<strong>quiet</strong>”. This is good for testing when you need a separate, clean network environment. Note that Host is not a member of the internal network and this mode allows vm’s to communicate with each other even when the Host is disconnected.</p><p>In this mode, VirtualBox does not provide support for the DHCP server. We can run <strong>DHCP</strong> server on our host system. Multiple internal networks are possible and you can configure VM’s to have multiple NICs to sit across internal and other network modes and thereby provide routes if needed.</p><p>In an internal network guests can see other guests on the same internal network, but host system cannot see this network. Manual network configuration of DHCP server is needed to configure this network.</p><p>This internal setting is very useful for running and testing the <strong>DPDK</strong> applications. Specially we will use internal network for forwarding packets between two virtual machines, using <strong>DPDK</strong> <strong>l2fwd</strong> application , as shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*V9Bf7YoBQJQpKLp3-ZuFQQ.png" /><figcaption>Reference: dpdk.org</figcaption></figure><h3><strong>DHCP server</strong></h3><p>Here we are going to create 2 internal network namely <strong>intnet1</strong> and <strong>intnet2</strong>, between two VM’s. The two internal networks will be used to receive and forward the packets, separately. For this, you need to run the following commands in your host terminal.</p><pre>vboxmanage dhcpserver add — netname intnet1 — ip 10.10.10.1 — netmask 255.255.255.0 — lowerip 10.10.10.2 — upperip 10.10.10.212 — enable</pre><p>•netname intnet1: The internal network will be named intnet1.</p><p>•ip 10.10.0.1: The IP address of your DHCP server inside the internal network.</p><p>•netmask 255.255.255.0: The subnet mask.</p><p>•lowerip 10.10.10.2: The lower bound of the IP addresses that can be assigned to network members.</p><p>•upperip 10.10.10.212: The upper bound of the IP addresses that can be assigned to network members.</p><p>•enable: Enable the DHCP server.</p><p>Similarly you can create the other internal network with similar command. You need to change the network IP address. Here is the example of creating a 2nd internal network, <strong>intnet2</strong>.</p><pre>vboxmanage dhcpserver add — netname intnet2 — ip 10.10.11.1 — netmask 255.255.255.0 — lowerip 10.10.11.2 — upperip 10.10.11.212 — enable</pre><p>After that open the setting of VM, by right clicking on it, then go to Network setting(from left panel). After that click on Adapter 2 and select the <strong>Internal Network</strong>(in Attached to:), then choose the network name as <strong>intnet1</strong>. if there’s no intnet1 just manually type intnet1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*OiK_Ag1vWCnMAPP0dG05qg.png" /></figure><p>Similarly, to add 2nd Internal Network click on Adapter 3 tab and follow the same procedure for <strong>intnet2.</strong></p><h3><strong>Testing connection between two VM’s</strong></h3><p>Now we will open the both VM’s and will check the connectivity between them using <strong>ping</strong> command.</p><p>First we need to check the network interface IP and for that we need to install <strong>ifconfig </strong>using following command</p><pre>sudo apt install net-tools</pre><p>Now if you run <em>ifconfig </em>command you will get the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8kIOayoczFFZgEh4LdpAg.png" /></figure><p>Here the <strong>enp0s8</strong> interface of both machines are on <strong>intnet1</strong> and can ping each other.</p><p>Similarly the <strong>enp0s9</strong> interface of both machines are on <strong>intnet2</strong> and can ping each other.</p><p>Now by using ping command check that both machines are connected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5uAs8UpVxj9FnX1QuhmzaQ.png" /></figure><h3>Increasing Core in VM’s</h3><p>Some DPDK applications need more than 1 core to run. So you need to allocate <strong>2 cores</strong> to the VM by doing the following steps.</p><ul><li>Turn <strong>OFF </strong>your virtual Machine.</li><li>Right click on VM and Select <strong>Settings.</strong></li><li>Now click on the <strong>System</strong> tab from the left panel and then go to <strong>Processor tab</strong>.</li><li>After that, enter 2(or more if your system has more cores) in the box in front of processors as shown in figure below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*vQYOecCSRXGN_AP6FbUG8A.png" /></figure><p>In next part, we will download and compile DPDK(using make and meson). Also we will be running the <strong>testpmd</strong> and <strong>l2fwd</strong> sample applications of DPDK, for forwarding packets between two separate virtual machines. Here is the Link(coming soon) for second part of article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da1b49a9bf5f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/emumba/setting-up-virtual-machines-for-dpdk-da1b49a9bf5f">Setting up Virtual Machines for DPDK</a> was originally published in <a href="https://medium.com/emumba">Emumba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>