Prefix == Netid / Suffix == Hostid
Prefix는 1~32bit까지 가능
Classful방식 에서 Classless방식으로 변화함에 따라 과거 Class A는 /8을 붙이는 형태로 변화함
classful은 Subnet으로 나누었다고 해도 하나의 네트워크로 본다.
즉, Network - Subnet - Host 구조
Classless는 쉽게 말해 classful + subnetting이라고 생각할 수 있다.
즉, Class 구분이 없는 Network - Host 구조
What is the prefix length and suffix length if the whole Internet is considered as one single block with 4,294,967,296 addresses?
(하나의 block이 4,294,967,296개의 주소를 가질 때, prefix와 suffix의 길이는?)
:
What is the prefix length and suffix length if the Internet is divided into 4,294,967,296 blocks and each block has one single address?
(하나의 address를 가진 4,294,967,296개의 block. prefix와 suffix의 길이는?)
:
One of the addresses in a block is 167.199.170.82/27. Find the number of addresses in the network, the first address, and the last address.
(주소의 수, 첫 주소, 마지막 주소 찾기)
:
| address | 167 | 199 | 170 | 82 |
|---|---|---|---|---|
| address | 10100111 | 11000111 | 10101010 | 01010010 |
| Network mask | 11111111 | 11111111 | 11111111 | 11100000 |
| &&연산(first address) | 10100111 | 11000111 | 10101010 | 01000000 |
| Last address | 10100111 | 11000111 | 10101010 | 01011111 |
The number of addresses in the network:
First address : 167.199.170.64/27
Last address : 167.199.170.95/27
One of the addresses in a block is 17.63.110.114/24. Find the number of addresses, the first address, and the last address in the block.
(주소의 수, 첫 주소, 마지막 주소 찾기)
:
Network mask : 255.255.255.0
The number of addresses in the network:
Fisrst address : 17.63.110.0/24
Last address : 17.63.110.255/24
One of the addresses in a block is 110.23.120.14/20. Find the number of addresses, the first address, and the last address in the block.
(주소의 수, 첫 주소, 마지막 주소 찾기)
:
| address | 110 | 23 | 120 | 14 |
|---|---|---|---|---|
| address | 01101110 | 00010111 | 01111000 | 00001110 |
| Network mask | 11111111 | 11111111 | 11110000 | 00000000 |
| &&연산(first address) | 01101110 | 00010111 | 01110000 | 00000000 |
| Last address | 01101110 | 00010111 | 01111111 | 11111111 |
The number of addresses in the network:
Fisrst address : 110.23.112.0/20
Last address : 110.23.127.255/20
An ISP has requested a block of 1000 addresses. The following block is granted.
:
An organization is granted the block 130.34.12.64/26. The organization needs four subnetworks, each with an equal number of hosts. Design the subnetworks and find the information about each network.
(하나의 block을 동일한 address수를 가진 네 개의 subnetworks로 나누어라.)
:
기존 Network address에서 2bit를 subnet으로 활용
suffix 부분을 모두 0으로 하면 해당 subnet의 첫 번째 address,
모두 1로 하면 해당 subnet의 마지막 address.
block이 가진 address 수 :
각 subnet이 가진 address 수 :
subnet1 : 130.34.12.64/28 ~ 130.34.12.79/28
subnet2 : 130.34.12.80/28 ~ 130.34.12.95/28
subnet3 : 130.34.12.96/28 ~ 130.34.12.111/28
subnet4 : 130.34.12.112/28 ~ 130.34.12.127/28
Original block을 위와 같이 Subblocks로 구성 가능.
An organization is granted a block of addresses with the beginning address 14.24.74.0/24. The organization needs to have 3 subblocks of addresses to use in its three subnets as shown below:
One subblock of 120 addresses.
One subblock of 60 addresses.
One subblock of 10 addresses.
(하나의 block을 서로 다른 수의 address를 가진 subblock들로 나누어라.)
block이 가진 address 수 :
Subblock들은 각각
120 ->
60 ->
10 ->
개의 address를 가지도록 구성되어야 한다.
subnet1(120/128) : 14.24.74.0/25 ~ 14.24.74.127/25
subnet2(60/64) : 14.24.74.128/26 ~ 14.24.74.191/26
subnet3(10/16) : 14.24.74.192/28 ~ 14.24.74.207/28
Unused(48) : 14.24.74.208 ~ 14.24.74.255
Assume a company has three offices: Central, East, and West. The Central office is connected to the East and West offices via private, 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 other offices.
(하나의 block을 세 office에 적합한 크기의 Subnet으로 구성하기)
:
Central block : 70.12.100.128/27 ~ 70.12.100.159/27
East block : 70.12.100.160/28 ~ 70.12.100.175/28
West block : 70.12.100.176/28 ~ 70.12.100.191/28
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:
We design the subblocks and find out how many addresses are still available after these allocations.
(세 subblock을 구성하고 이후에 남은 addresses는?)
:
-> Subnetting의 목적은 효율적인 사용을 위함이다. 따라서 subblock의 수가 아닌 suffix의 수에 맞춰 subblock을 구성한다.
1) suffix의 2비트를 이용하여 Network를 4 group(first, second, third, unused)으로 나눈다.
2) first group부터 suffix length와 subblock의 수를 고려하여 subnet length 구성
: NAT router는 200.24.5.8 -> 172.18.3.1 임을 어떻게 아는가?
: 2개 이상의 PC가 같은 목적지 주소에 접속한다면 NAT router는 그 PC들을 어떻게 구분하는가?
외부에서 사설주소의 서버로 접속할 수 있도록 하는 것 (일반적으로는 접속 불가)
외부의 특정 port와 사설 주소의 특정 port를 연결시켜 주는 것
ex) NAT router에 9000번 port로 패킷이 들어오면 내부 8080번 port로 전송해라