LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2002, 02:06 PM   #16
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40

Quote:
So, I guess the answer to my question about subnet masks is that they are ONLY used for broadcasting. They can also be looked at and the network can be determined from them, but their real use is for broadcasting....
No. As I said before, your machine will go to any machine on the same subnet (with the subnet mask coverage) directly (and those machines can be connected to your ethernet interface). For any off-subnet IP's, it will ask the gateway to please forward the packet to the destination (because it's not on its own local network). Aside from broadcasting issues, the mask really determines when to go through the gateway and when not.

mlp
 
Old 08-25-2002, 02:33 PM   #17
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Quote:
Originally posted by jeremy
lynch, classful subnetting is still very much in use. I don't think he was calling the whole post rubbish, just saying that 10.0.0.1 could have a number of netmasks.
Yup, hence two separate posts

Regards
 
Old 08-25-2002, 02:42 PM   #18
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Quote:
Originally posted by lynch
Yes it is common.But classful subnetting is still in use,thus it is not obsolete.
Most netblock owners, who got their block pre-CIDR, have been asked to give back unused parts. Microsoft, for example, own at least one class A. To get a /24 or larger you a required to fill in a RIPE141, presumably on the basis that, if you can understand one of these enough to sucessfully complete the form, there's a vague chance you have a suitable use for the netblock

Quote:
And I dont like my posts being called rubbish,but I'll put that down to snobbery.
Then don't post things that are, at best, misleading.

Regards
 
Old 08-26-2002, 04:46 AM   #19
lynch
Member
 
Registered: Nov 2000
Location: A Mid-Atlantic state
Distribution: SuSE 8.1,Knoppix 3.2,Mandrake 9.1
Posts: 388

Rep: Reputation: 30
Quote:
Then don't post things that are, at best, misleading.
So now I'm being accused of writing posts that are misleading.At best, I try to offer the simplest answer to a question.No doubt MartBrooks has the expertise in these matters and I respect that.But I'm guessing the majority of people who read these posts are not netblock owners and the ones who are dont need CIDR explained to them.CIDR isnt needed when setting up a simple lan with one host using the internet.
Any,I wont derail this thread any further by replying to these flames.
Sorry ionized.
lynch
 
Old 08-27-2002, 10:47 AM   #20
Ionized
Member
 
Registered: Jul 2002
Location: Chicago Suburbs
Distribution: Slackware 8.0
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by lynch

Any,I wont derail this thread any further by replying to these flames.
Sorry ionized.
lynch
Actualy, you've all been very helpful. The thing I wanted to hear was that the subnet defines a network SO THAT packets destined outside the defined network go through the router. I work with ipchains for my firewall and I know this is where you can use netmasks to define blocks of addresses to block, I just didn't know the application when setting up a network in linux or windows.

I'm still a little confused on broadcast addresses now though, heh. So if I define my network&mask as 10.0.0.1/255.255.255.127
what exactly is the broadcast address? I thought that if a network was defined as 10.0.0.1/24 then the broadcast would be 10.0.0.255....but how is that defined? Also, when exactly is the broadcast used...is it used to send out packets to find certain IP addresses on the network or something?

Thanks a lot for all your help with my questions
 
Old 08-27-2002, 11:29 AM   #21
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally posted by Ionized

Also, when exactly is the broadcast used...is it used to send out packets to find certain IP addresses on the network or something?
Broadcast is used when the same message is sent to many machines. With broadcast it's sent only once. Using normal methods of connection - once per client.
 
Old 08-29-2002, 10:05 AM   #22
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
The subnet mask is used by the computer to decide which route to send packets.

so, if you have a 10.0.0.1/24 setting in a pc,
the addresses 10.0.0.1 to 10.0.0.254 will be on his LOCAL network.
Every subnet has two reserved addresses, the 1st and the last.
10.0.0.0 is the 'network' number and 10.0.0.255 is the 'broadcast' number.
Any other addresses are passed to the gateway device for routing.

So, if you have 10.0.0.1/25, addresses 10.0.0.1 to 10.0.0.126 are local
10.0.0.0 is the 'network' number & 10.0.0.127 is the broadcast address

(The other network there will be 10.0.0.128, broadcast 10.0.0.255, members 10.0.0.129 to 10.0.0.254 )
Confused?

Regards,
Peter

Last edited by peter_robb; 08-29-2002 at 10:11 AM.
 
Old 06-09-2007, 01:35 AM   #23
shogun1234
Member
 
Registered: May 2004
Posts: 226

Rep: Reputation: 15
How do I know a subnet is a valid subnet mask for a given class, notably if it is a non-contiguous subnet mask?

For example, given an IP '144.32.176.9' with its subnet mask '255.255.252.7'?

In addition, with that given pair, how can I use subnet mask (with its IP address) to work out its host id? It is B class, so I can use 255.255 to translate it back to net id 144.32 (is this correct?). Yet I do not know how to translate it back to its host id with 1111110000000111(252.7) and 1011000000001001 (176.9), if I use 'Not' then 'And' operation to combine it together.

I appreciate any advice,

Last edited by shogun1234; 06-09-2007 at 01:43 AM.
 
Old 06-09-2007, 02:05 AM   #24
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
A subnet mask must follow a particular form. It is 32 bits long and the it must be a sequence of 1 bits with all the rest of the bits being 0 (OK, this is a lousy explanation, so I'd say just go read the Wikipedia article which explains it with a nice chart). Therefore 255.255.252.7 is an invalid subnet mask, as in binary it is 11111111.11111111.11111100.00000111 which breaks the "all ones, then all zeros" rule. However, 255.255.252.0 would be a valid subnet mask.

The subnet mask is logically ANDed with the IP address to produce the network IP. For 255.255.252.0 this network IP is the first 22 bits of the IP address. Therefore, the host IP is the remaining 10 bits. Remember, with classless routing, you can't necessarily determine the subnet mask just by looking at the IP address! The Wikipedia article has a fiuller explanation of this...
 
Old 06-09-2007, 02:56 AM   #25
shogun1234
Member
 
Registered: May 2004
Posts: 226

Rep: Reputation: 15
Quote:
Originally Posted by btmiller
A subnet mask must follow a particular form. It is 32 bits long and the it must be a sequence of 1 bits with all the rest of the bits being 0 (OK, this is a lousy explanation, so I'd say just go read the Wikipedia article which explains it with a nice chart). Therefore 255.255.252.7 is an invalid subnet mask, as in binary it is 11111111.11111111.11111100.00000111 which breaks the "all ones, then all zeros" rule. However, 255.255.252.0 would be a valid subnet mask.

The subnet mask is logically ANDed with the IP address to produce the network IP. For 255.255.252.0 this network IP is the first 22 bits of the IP address. Therefore, the host IP is the remaining 10 bits. Remember, with classless routing, you can't necessarily determine the subnet mask just by looking at the IP address! The Wikipedia article has a fiuller explanation of this...
Thanks your reply.

I understand that the subnet mask should have bits started with 1 (at leftmost) and ended with 0 (at right most). For example, 11111111 11111111 00000000 00000000. What I am confused is - I read the RFC 905, in which it states that a non-contiguous subnet mask is also valid, though it is not recommended.

If the given example ('144.32.176.9' & '255.255.252.7') is not an invalid subnet mask, would you please to show me which pair (IP & subnet mask) is a valid IP & subnet mask (non-contiguous subnet mask) and how to prove that it is valid?

Thanks your explain. I sincerely appreciate it.
 
Old 06-10-2007, 12:20 AM   #26
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
It looks like RFC 905 is a meta-document suggesting practices for transport protocol specification and not itself a specification of how IP subnetting should work (correct me if I'm wrong -- I didn't read it all that carefully). One could design a protocol where non-contioguous subnet masks are valid (it just means that the "host part" of the address would be somewhere in the middle of the address rather than the ending parts, e.g. you could make bits 12-20 of a 32 bit address the "host part" and the rest the "network address"). I don't know why anyone would ever want to do such a thing, but it's possible. However, AFAIK, IP never does this and subnet masks must be contiguous.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
subnet mask kizersouzay Linux - Networking 1 08-31-2005 03:07 PM
2 nics on the same subnet mask wrexy Linux - Networking 6 10-11-2004 05:33 PM
Setting IP Address and Subnet Mask and whatnot... Sloanr333 Linux - Networking 6 11-06-2003 11:39 PM
Remote Subnet Mask? - help! MikHud Linux - Networking 2 01-14-2003 05:21 AM
Subnet mask mikeshn Linux - Networking 1 08-26-2002 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration