A kind of arithmetic for subnetting and ip address management

September 2nd, 2010

A kind of arithmetic for subnetting and ip address management
Written by www.softsession.com

This document describes a kind of data structure and arithmetic for
subnetting. With this arithmetic, the required subnet can be quickly
located in a network with complicated hiberarchy.
Because network segment is identified by IP address and mask, such as
192.168.0.0/24. And IP address and mask is represented by 32 bits
Binary. The binary tree can be used to describe the net structure and
save IP address management information.
Eg. A organization has the network segment 192.168.0.0/22, and there
are two departments( Department A and Department B) under this
organization. Department A was assigned subnet 192.168.0.0/25 and B was
assigned subnet 192.168.1.0/25,the network structure chart is as
following:
http://www.softsession.com/resource/images/network4.gif

Below is the IP address management information structure chart
represented by binary tree :
http://www.softsession.com/resource/images/network3.gif

The data structure of each node is as below:
 struct SNetdata
{
        string sIP;   //subnet ID, identified by IP address and mask, such as
192.168.0.0/24
        int iNodeType;
        string sLeftIP;   // left subtree node, left subtree subnet ID
        string sRightIP;  //right subtree node, right subtree subnet ID
        string sParentIP;  //parent node, parent subnet ID
};

There are four types of node: used, unused, middle node, root node, as
below:
enum NODE_TYPE
{
        USEDNODE=1,     //used node
        UNUSEDNODE=2,  //unused node
        MIDDLENODE=3, //middle node, which is generated during the course of
subnetting
        ROOTNODE=4,    //root node

};

IP address management information is saved in these nodes. All these
nodes can be linked by double linked list. Considering the subnet ID
will be frequently used to perform searching in the IP address
management dataset, thus the map of STL is used to save each node and
subnet ID is used as index key in order to quicken the searching speed.
typedef map<string,SNetdata,less<string> > MAPNetData;
MAPNetData NetDatas;

Assumed that the organization is newly added Department C and
Department D. C is needed to assign a 25-bits mask subnet and D is
needed to assign a 24-bits mask subnet.
The general IP address management software and subnet calculator can’t
solve this problem. With the binary tree data structure, the problem
can be solved easily. For the first problem, to assign a 25-bits mask
subnet for Department C, we preorder traversal the binary tree
beginning from the root node 192.168.0.0/22, to find the leaf node of
unused type and the mask less or equal 25. In this example, we can find
192.168.0.128/25, which is the subnet assigned for Department C.

Traversal arithmetic is as below:
int TraversalTree(string StartIP, int iTarMask, string& ResIP)
/*
StartIP: represents the subnet ID of the beginning node when preorder
traversalling the binary tree. In this example it is root
node192.168.0.0/22.
iTarMask: represents the mask of the target node we are searching for
ResIP: represents the subnet ID of the target node we have found
*/
{
        MAPNetData::iterator MyIterator;
        SNetdata NetData;
        int iSrcMask;   // represents the mask passing the node when traversal
the tree
        int iRes,k;
        string tmpstr;

        MyIterator=NetDatas.find(StartIP);
        if(MyIterator==NetDatas.end())
                return -1;
        NetData=(*MyIterator).second;

        tmpstr=StartIP.substr(StartIP.find("/",0)+1,2);
        iSrcMask=atoi(tmpstr.c_str());

        if(iSrcMask>iTarMask)
                return 3;

        if(NetData.LeftIP==""&&NetData.RightIP=="")
        {
                if(NetData.iNodeType==UNUSEDNODE)
                {
                        ResIP=NetData.IP;
                        return 1;   // Have found it
                }
                else
                        return 2;
        }

        iRes=TraversalTree(NetData.LeftIP,iTarMask,ResIP);
        if(iRes<0||iRes==1)
                return iRes;

        iRes=TraversalTree(NetData.RightIP,iTarMask,ResIP);
        if(iRes<0||iRes==1)
                return iRes;

        return 0;

}

Then for the second problem, to assign a 24-bits mask subnet for
Department D. Following the above mentioned arithmetic to traversal the
binary tree, we can find 192.168.2.0/23. Cause the assigned subnet is
24-bits mask, we need to perform subnetting under this node. Then we
will get 192.168.2.0/24, which is the subnet we needed. After the
assigning, the IP address management information structure chart
represented by binary tree is as below:
http://www.softsession.com/resource/images/network2.gif

For the details, see http://www.softsession.com/resource/ref1.htm

Search Engines

September 2nd, 2010

Search Engines!
Why so many and what are the top five?

www.Click4.Name

Plesk DNS Set Up

September 2nd, 2010

Hi – I have just signed up for a Virtual Private Server.

I have 1 IP address and need to get my DNS server (or configuration)
set up so that my server can resolve domain names to IP addresses (for
example, at the moment, ping google.com in SSH simply does not work at
the moment – and I am having similar problems getting my scripts to
resolve domain names too).

Much of what I have read thus far suggests I need 2 IP addresses for
the DNS server alone. I don’t mind whether I run my own DNS Name Server
or use another – what is best?

I am using Plesk 7.5 Reloaded and Virtuozzo.

As I say, I have one IP address but wish to host several domains on my
VPS.

I would be enormously grateful for any help in sorting the
configuration for this out.

Many thanks
Steve

CSS column not lining up properly

September 2nd, 2010

I’m trying to put together a sample web page using a CSS 3 column layout
that I hope to be use to eventually redesign a site and eliminate use of
tables. I have a page mocked up as a sample but I’ve some across an
annoying CSS problem that I can’t find a solution for and am open to
suggestions.

http://www.melroseymca.org/boxtest.htm

When you view source, lines 16 to 99 are the ones for the boxes. All
other ones are from an imported site stylesheet.

The right hand column where there is text doesn’t quite line up with the
rest of that column where there isn’t any text. It makes a very
noticeable (to me anyway) blue line at the top right corner of the
column. It also doesn’t line up on the left side of the right column as
it jogs out where there is text.

The problems show in IE, Netscape and Firefox so I don’t think it’s a
browser rendering problem. But I’ve tried changing 50 things and can’t
get it to display any better. I’m obviously missing something. They
aren’t dealbreakers but they are definitely annoying.

Anyone got any idea on how I get rid of these two problems?

[OT] Sharks

September 2nd, 2010

Hockey in CA?

http://www.sjsharks.com/index2.html
In the hunt for the Stanely Cup.

Speaking of Stanely Cup
http://www.nytimes.com/2006/05/07/sports/hockey/07cheer.html

post your classifieds FREE!

September 2nd, 2010

I found this great site where you can post free classified ads , check it out, http://www.vericites.com .  they dont even make you register.

 Posted Via Usenet.com Premium Usenet Newsgroup Services
———————————————————-
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
———————————————————-        
                http://www.usenet.com

need help: crawling URL redirected pages compared to regular domains

September 1st, 2010

i hope im posting in the right place and someone can give me some
suggestions here.

basically im making a site with google pages.
but seeing as typing in
mysite.googlepages.com
is a bit more work than typing in
mysite.com
i decided to register for a url redirect domain.

when i tested the redirection method i noticed this in the page source:

<meta http-equiv="ROBOTS" content="NOINDEX,FOLLOW">
<frame name="_redirected_content_"
src="http://’mysite’.googlepages.com/" scrolling="auto"
frameborder="0">

seeing ‘noindex’ scared me a little.
knowing that my real pages are actually nested in frames scared me even
more.
this is because i noticed that while browsing through my site, this
outer redirect frame is always present.

my questions:
does this mean search engines will not index any of the pages if i
submit my redirect url to them?
assuming it will index all my pages, will the frames interfere with the
indexing process?
in fact, i cant really tell the difference between an indexed page and
a non indexed page. non indexed pages mean…they dont come up in
search engines?

sorry, i am a beginner with SEOs and all.
hope someone can understand me and give me some suggestions.
Thanks.

http://www.isamphibian.com

NEW SITE needs comments

September 1st, 2010

I have designed new site and i am just amateur.
www.vjekoslav-cvitkovic.iz.hr
Can you tell mi yours comments?

Amusing ebay

September 1st, 2010

Look carefully at the main picture…..Do you reckon it was intentional?

http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=7764278450&ru=ht…
F%2Fsearch.ebay.co.uk%3A80%2Fsearch%2Fsearch.dll%3Ffrom%3DR40%26satitle%3D77
64278450%26fvi%3D1

Critique

September 1st, 2010

OK, here goes:
http://www.nct.org.uk/

Please bear in mind that this site was a team effort, so not everything is
my fault / to my credit. But I’m not going to tell you which bits I did,
which bits I like, and which bits I think are stupid because I want to
hear all the feedback you have!

That said, if you’re going to judge it on quality of coding, please look
at the source for one of the non-homepage pages as well!

For purpose of comparison:
http://archive.nct.org.uk/


Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact