EzDoum

찾기
처음으로 | 찾기 | 아카이브 | 글 올리기 | 링크 | 자료실 | 통계 | 연락처 | 자유게시판
이지도움 특집
전체보기
네트워크
TI OMAP35x
TI DaVinci
Analog Blackfin
RobotWar2005
임베디드!
캐쉬의 모든것
메모리 할당 알고리즘
CPU 파이프라이닝
자료구조(Tree)
금융

Login
이름

암호

기억하기


사용자 등록

현재 접속중인 등록 사용자는 0명, 익명 사용자는 2명 입니다.
전체 등록 사용자: 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) 프로그래밍
·GNU REGEX (정규표현식) 프로그래밍 강좌 (7)
·Sorting Algorithm Animation (2)
·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
range...?


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
network.


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 255.255.255.255 1/256 Class C 1
/31 255.255.255.254 1/128 Class C 2
/30 255.255.255.252 1/64 Class C 4
/29 255.255.255.248 1/32 Class C 8
/28 255.255.255.240 1/16 Class C 16
/27 255.255.255.224 1/8 Class C 32
/26 255.255.255.192 1/4 Class C 64
/25 255.255.255.128 1/2 Class C 128
/24 255.255.255.0 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 192.168.0.0 network):


192.168.0.0 --> 192.168.0.31
or
192.168.0.32 --> 192.168.0.63
or
192.168.0.64 --> 192.168.0.127
.
.
.
192.168.0.224 --> 192.168.0.255


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: 192.168.0.1
Subnet Mask: 255.255.255.224


of machine #2
IP address: 192.168.0.2
Subnet Mask: 255.255.255.224

of machine #3
IP address: 192.168.0.3
Subnet Mask: 255.255.255.224
.
.
.
of machine #17
IP address: 192.168.0.18
Subnet Mask: 255.255.255.224


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
255.255.255.224 the machines on your subnet (in this case 0-31) will all
broadcast on the same broadcast address (192.168.0.31)...hence 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
available.


Check subnet valid range:


I have written a simple cgi program to calculate you subnet that you are
on:
http://www.infiltration.net/subnet.html


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

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

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

    검색
    Google

    분류
    ·공지 (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)

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

    랜덤 링크
    http://kldp.net


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