Chapter 06 IP Address
IP Address Internet address IP 계층에서사용되는식별자 32 bit 2 진주소 The address space of IPv4 is 2 32 or 4,294,967,296 netid 와 hostid 로구분 인터넷에서호스트와라우터를유일하게구분
IP Address Structure 2-Layer Hierarchical Structure netid + hostid 먼저 netid 를사용하여네트워크에도달한후에 hostid 를사용하여호스트에도달
IPv4 Address Formats
Dotted Decimal Notation 보다편리하고읽기쉽게하기위해사용
Addresses Per Class
Example : Class C Address
Masking IP 주소중에서네트워크주소를추출하기위해마스크이용 마스크 : 1- netid, 0 - hostid The network address is the beginning address of each block. It can be found by applying the default mask to any of the addresses in the block (including itself). It retains the netid of the block and sets the hostid to zero.
Internet Example 220.3.6.0( 클래스 C) 는토큰링 200.78.6.0은교환망 134.18.0.0( 클래스 B) 는이더넷 207.42.56.0( 클래스 C) 는점-대-점 WAN 124.0.0.0( 클래스 A) 는이더넷
Special Addresses
Direct Broadcast Address Hostid 필드가모두 1 인주소 라우터가특정네트워크의모든호스트에패킷을보낼때사용 목적지주소로만사용
Limited Broadcast Address 현재네트워크의브로드캐스트주소 호스트가현재네트워크내의모든호스트에게메시지전달 다른네트워크로가는것을라우터가제한함 클래스 E 주소
This Network Netid 필드가모두 0 인주소 같은네트워크에있는다른호스트에게메시지보낼때사용 ( 라우터에서차단 )
Loopback Address 첫번째바이트가 127 인 IP 주소 소프트웨어시험용 클라이언트프로세스가동일한시스템상에있는서버프로세스에게메시지전송시사용목적지주소로만사용
Classless Addressing Entire address space (2 32 addresses) is divided into blocks of different sizes Classless Interdomain Routing (CIDR) Classful addressing is a special case of classless addressing. n = 8 (class A), 16 (class B), or 24 (class C)
Prefix Length Prefix : netid Suffix : hostid
Example : Classless Addressing Q: Find the block if one of the addresses is 190.87.140.202/29. A: 202 = 11001010. The first address is 190.87.140.200/29. The number of addresses is 2 32 29 or 8. The last address is 190.87.140.207/29. The first address needs to be used as the network address and the last address is kept as a special address (limited broadcast address).
Subnetting Each LAN assigned subnet number Site looks to rest of internet like single network Local routers route within subnetted network
3-Layer Hierarchical Structure
Subnet Mask Subnet mask indicates which bits are subnet number and which are host number Binary Representation Dotted Decimal IP address 11000000.11100100.00010001.00111001 192.228.17.57 Subnet mask 11111111.11111111.11111111.11100000 255.255.255.224 Bitwise AND of address and mask (resultant network/subnet number) 11000000.11100100.00010001.00100000 192.228.17.32 Subnet number 11000000.11100100.00010001.001 1 Host number 00000000.00000000.00000000.00011001 25
Subnet and Mask
Routing Using Subnets
Example 1 : Subnetting B 클래스주소를가진기관에서 12 개의서브넷이필요할때 12개지만 14개필요 (subnetid 필드가모두 1인것과0인것 ) 서브넷할당을위한최소비트수 : 4개 나머지 12개비트는 hostid (2 12 = 4,096) 지정, 실제는 4,094 개 Mask = 255.255.240.0 (240 = 11110000) 서브넷 X.Y.0000hhhh.hhhhhhhh (X.Y.0.0) ~ X.Y.1111hhhh.hhhhhhhh (X.Y.240.0)
Example 1 : Subnetting ( 계속 )
Example 2 : Subnetting A company has three offices: Central, East, and West. The Central office is connected to the East and West offices via private, point-to-point WAN lines. The company is granted a block of 64 addresses with the beginning address 70.12.100.128/26. The management has decided to allocate 32 addresses for the Central office and divides the rest of addresses between the two offices. R West R R Central R R 64 addresses East
Example 2 : Subnetting( 계속 ) The company will have three subnets, one at Central, one at East, and one at West. a. The Central office uses the network address 70.12.100.128/27 (70.12.100.10000000/27). The addresses in this subnet are 70.12.100.128/27 to 70.12.100.159/27. (32 addresses) Note that three of these addresses are used for the routers and the company has reserved the last address in the sub-block. Note that the interface of the router that connects the Central subnet to the WAN needs no address because it is a point-to-point connection.
Example 2 : Subnetting( 계속 ) b. The West office uses the network address 70.12.100.160/28 (70.12.100.10100000/28). The addresses in this subnet are 70.12.100.160/28 to 70.12.100.175/28. (16 addresses) Note that one of these addresses is used for the router and the company has reserved the last address in the subblock. c. The East office uses the network address 70.12.100.176/28. (70.12.100.10110000/28) The addresses in this subnet are 70.12.100.176/28 to 70.12.100.191/28. (16 addresses) Note that one of these addresses is used for the router and the company has reserved the last address in the subblock.
Example 2 : Subnetting( 계속 )
Example 3 : Subnetting An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations.
Example 3 : Subnetting( 계속 ) Group 1: 64 개의서브넷, 서브넷당 256 개의주소필요 (8 비트의 suffix 와 24 비트의 prefix) 01 : 190.100.0.0/24 ~ 190.100.0.255/24 02 : 190.100.1.0/24 ~ 190.100.1.255/24.. 64 : 190.100.63.0/24 ~ 190.100.63.255/24 Total=64 256 = 16,384 Group 2: 128개의서브넷, 서브넷당 128개의주소필요 (7비트의 suffix와 25비트의 prefix) 001 : 190.100.64.0/25 ~ 190.100.64.127/25 002 : 190.100.64.128/25 ~ 190.100.64.255/25.. 128 : 190.100.127.128/25 ~ 190.100.127.255/25 Total = 128 128 = 16,384
Example 3 ( 계속 ) Group 3: 128 개의서브넷, 서브넷당 64 개의주소필요 (6 비트의 suffix, 26 비트의 prefix) 001 : 190.100.128.0/26 ~ 190.100.128.63/26 002 : 190.100.128.64/26 ~ 190.100.128.127/26 128 : 190.100.159.192/26 ~ 190.100.159.255/26 Total = 128 64 = 8,192 Number of granted addresses: 65,536 Number of allocated addresses: 40,960 Number of available addresses: 24,576
Example 3 : Subnetting( 계속 )
Private IP Address 사설망내부에서만사용하는 IP 주소공간 Class A : 10.0.0.0-10.255.255.255 Class B : 172.16.0.0-172.31.255.255 Class C : 192.168.0.0-192.168.255.255 공인 IP 공간절약 내부에서는사설 IP주소만사용하고외부트래픽일경우공인 IP 주소로변환사설망보호 사설망의내부 IP주소를모르기때문에공격불가능 Internet 202.103.106.5 Load Balancer 172.16.0.1 172.16.0.0/255.255.255.0 172.16.0.2 172.16.0.3
Summary IP address structure Subnetting