Networking Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationNetworking Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 29th, 2012, 09:02 AM
matthayzon matthayzon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 37 matthayzon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 30 m 4 sec
Reputation Power: 2
Netid and hostid of any given IP address?

Hello,
I am trying to understand how to figure out the Netid and Hostid of any given IP address (manually that is without using CMD).

I know that it has a lot to do with the class that the IP address belongs to. For example, if leftmost bit of the first octet starts with a 0, it belongs to class A.

That is where I get stuck, once I determine what class an IP address belongs to, I am unable to identify which portion of the address is dedicated to the network and the host.


Thank in advance for any help.

Reply With Quote
  #2  
Old January 29th, 2012, 10:23 AM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,931 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 43 m 47 sec
Reputation Power: 6991
To do it by hand you need to know the table:
http://en.wikipedia.org/wiki/Classful_network

It's not necessary to memorize the entire table, because it's not hard to figure it out on the fly and there are plenty of patterns. When you need to remember is how to identify the class of the address and the size of each class.

So if you have an address that starts with 110 you need to recognize that it's a class C address and a class C address has 24 bits in the network part of the address (including the 110). Since all addresses have 32 bits, the last 8 bits of the address must be the host part.

Wikipedia also has multiple examples like this one:
Code:
Class C
192.  0.  0.  0 = 11000000.00000000.00000000.00000000
223.255.255.255 = 11011111.11111111.11111111.11111111
                  110nnnnn.nnnnnnnn.nnnnnnnn.HHHHHHHH
__________________
PHP FAQ
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #3  
Old January 29th, 2012, 10:33 AM
matthayzon matthayzon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 37 matthayzon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 30 m 4 sec
Reputation Power: 2
So, for example if the IP address was 140.10.33.17.

That would mean the IP address belongs to the B class since the leftmost octet starts with 10, and Class B addresses have 16 host and network bits, right?

So....class C always has 24 network bits, class B addresses always have 16 network bits, and class A always has 8 network bits? and the remaining bits are dedicated to the host?


I appreciate your help I think I get it now!

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationNetworking Help > Netid and hostid of any given IP address?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap