처음으로 | 찾기 | 아카이브 | 글 올리기 | 링크 | 자료실 | 통계 | 연락처 | 자유게시판
이지도움 특집
TI DaVinci
Analog Blackfin
캐쉬의 모든것
메모리 할당 알고리즘
CPU 파이프라이닝




사용자 등록

현재 접속중인 등록 사용자는 0명, 익명 사용자는 3명 입니다.
전체 등록 사용자: 751명

마지막 답장
·libcurl + fuse 조합으로 되는게 많네. (1)
·Linux Ftrace에 관해 (3)
·Android MTP ( Media Transfer Protocol ) (1)
·Lighttpd에 인증을 digest 사용시 IE 오동작 문제? (1)
·Dtrace에 관해 (1)

·OpenSSL and multi-threads (0)
·ARM 환경에서 OpenCL 사용 (0)
·IoT용 WIFI 모듈 비교 ( MCU ) 클래스 (0)
·Glances - 리눅스 여러 가지 항목을 한 화면에서 모니터링 (0)
·plugin 방식의 로그 분석기 (0)

뜨거운 감자
·나는 인터렉티브한 환경에서 역어셈블 한다. (12)
·GNU REGEX (정규표현식) 프로그래밍 강좌 (7)
·SoCRobotWar 2005 - 신입생 기초 교육자료 (7)
·ASP.NET의 데이터 그리드와 사용자 컨트롤 (7)
·DHTML Editing Control (7)

가장 많이 읽은 글
·[Cache] 2-way Set-Associative 방식이란 무엇일까? (2)
·멀티쓰레드(Pthread) 프로그래밍
·Sorting Algorithm Animation (2)
·GNU REGEX (정규표현식) 프로그래밍 강좌 (7)
·SoCRobotWar 2005 - 신입생 기초 교육자료 (7)

TCP/IP subnetting
글쓴이: EzDoum 글쓴날: 2002년 09월 26일 오후 03:35

Subnet Calculator: http://www.rogness.net/subnet.html

So what is a subnet?

A subnet is a logical break up of one large network into smaller
subnetworks by using a 'base' network and a subnet mask declaration to
produce a broadcast domain common to all hosts applied to that subnetwork.

Why use a subnet?

There are a couple of reasons to use a subnet range of IP's. One might be
to break broadcast domains into more manageable subnetworks to avoid
network broadcast collisions.

ie: What happens when you have 3000 machines on 1 local network all
broadcasting?...The machines on that network would spend most time
processing broadcasts packets.

Another reason could be to conserve on IP addresses instead of wasting
full ranges on let's say a PPP link.

ie: PPP connections only need 2 ip's to operate on for that given
network. So why waste valueable IP's for links that never use an entire

Another, and most popular, is to make 2 networks talk to each other that
are not directly connected (on same LAN) with routers. Usually caused by
distance limitations (without running a transparent ethernet
bridge)...remote networking. This becomes very inportant when dealing
with WAN networking schemes and design.

ie: Will be discussed later on.

Another reason may be for manageability. Subnets could be used to limit
communication between networks. Also ease of firewall support for that

ie: Network A might need to talk to Network B and Network A might need
to talk to Network C, but Network C can not talk to network B.

So how do I subnet?

Knowing the breakdown is essential. In the real world, IP's are as scarce
as virgin's in Vegas... you would be lucky to get a couple of Class C's
unless you are an Upstream Provider. Therefore learning how to do this
might be usefull some day.

Anyway, Look at this table and know it...really know it well:

CIDR Dotted Networks Number of
Notation Decimal Available IP's
/32 1/256 Class C 1
/31 1/128 Class C 2
/30 1/64 Class C 4
/29 1/32 Class C 8
/28 1/16 Class C 16
/27 1/8 Class C 32
/26 1/4 Class C 64
/25 1/2 Class C 128
/24 1 Class C 256

I am only going to cover subnetting of Class C networks, but the same
theory can be applied to Class B and Class A network blocks.

Most text's explain subnetting in a bit borrowing explaination which can
get confusing to most so I devised an easy way to do this in 3 steps:

1) Determine the number of hosts that need to be on the subnetwork.

ie: Lets say we have 17 machines on this network.

2) Look in the table and see which subnet block we can use for this.

ie: Can't use /28...to small...OK, we can use /27 (32 IP's)

3) Now, here's the important part. A subnet can only start (the base
value) on a host number that is evenly divided by the number of IP's for
the chosen subnet. A /27 can not start on .8, for example, because 32 is
not evenly divided into 8. Likewise a /26 can not start on .16 because 64
is not evenly divided into 16. HINT: Just take the number of IP's for the
subnet, start at 0 and keep adding them onto each other until you get to
256. Those numbers are your allowed base network addresses. So a /27
valid base addresses would be 0,32,64,96,128...224. *note* the broadcast
address is always 1 minus the next up base subnet address.

ie: Since we chose a /27 that means it can start on:
0,32,64,96,128...224. So the IP range for this subnet would be
(using network): -->
or -->
or -->
. -->

Note: You can not use the bottom address and the top address. So actually
you only have n-2 IP addresses available for use by actual hosts. This is
because the bottom address is subnet declaration and the top address is
the broadcast address for that subnet. On non-host (non-broadcast)
networks you can use the broadcast address as an actual IP on your
network. This is commonly used in routers or COM servers to define a
subnet of multiple subnets. Some router configs allow you to use .0 as an
address as well.

Now once you have a subnet picked out (that is not used), You can start
assigning addresses for the hosts on that network.

ie: So to the actual address assignment of the machines on
your subnet (Machine #1,#2,#3...#17 using the 0-32 subnet block):

TCP/IP settings
of machine #1
IP address:
Subnet Mask:

of machine #2
IP address:
Subnet Mask:

of machine #3
IP address:
Subnet Mask:
of machine #17
IP address:
Subnet Mask:

Now you can see I used numbers 1-18 for my IP addresses in sequence, but
you can use any host numbers between 1-30 for the subnet range 0-31, 33-62
for subnet range 32-63, 65-94 for subnet 64-95, etc, and they don't have
to be in sequence either. Since you specified the subnet mask of the machines on your subnet (in this case 0-31) will all
broadcast on the same broadcast address ( creating
your subnet.

Keep in mind when you are dealing with host networks you can only use n-2
number of actual IP addresses so if you need 16 IP's for 16 nodes or
machines you can not use a /28 even though the table says there are 16

Check subnet valid range:

I have written a simple cgi program to calculate you subnet that you are

  • 관련 링크
  • [분류: 인터넷 인쇄용 페이지 본문 email로 보내기 ]

    <  .NET 가비지 콜렉터의 Profiler | Hyperlinked C Sharp Grammar  >

    답장 쓰기
    글을 올리시려면 로그인 (사용자 등록) 하셔야 합니다.


    ·공지 (6)
    ·인터넷 (87)
    ·하드웨어 (260)
    ·C/C++ (65)
    ·어셈블리 (7)
    ·리눅스 (136)
    ·리눅스 커널 (67)
    ·윈도우즈 (25)
    ·데이터베이스 (20)
    ·보안 (16)
    ·.NET (25)
    ·그래픽 (13)
    ·책소개 (42)
    ·호기심 천국 (80)
    ·잡담 (111)
    ·사랑 (3)

    전체 본문수: 963
    전체 답장수: 525

    분류 : 인터넷
    가장 많이 읽은 글
    ·축구관련 사이트 모음! (0)
    뜨거운 감자
    ·DHTML Editing Control (7)

    이지도움 어때요?
    이게 뭐야. 다시 안올란다. --;
    아이 좋아라~ +_+;
    먼가는 있는거 같은데 뭐하는 곳이지?
    기타 (자유게시판에 글로 남겨 주세요)
    [ 결과 | 투표 ]

    랜덤 링크

     Home ^ BACK TO TOP ^ EzDoum - 도움이 필요하세요~??
     Powered by KorWeblog 1.5.8 Copyleft © 2001 EzDoum, 관리자: EzDoum