Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
IPアドレス(IPv4)の仕組み/overview-of-ipaddress
Search
nishina
March 26, 2018
Programming
0
110
IPアドレス(IPv4)の仕組み/overview-of-ipaddress
nishina
March 26, 2018
Tweet
Share
More Decks by nishina
See All by nishina
1週間で終わらせるはじめてのGo言語学習/beginner-study-go
nishina555
1
110
Postmanを利用したAPI開発/postman-tutorial
nishina555
0
67
テキスト校正ツールtextlintの 紹介と導入方法/textlint-overview
nishina555
0
69
認証・認可の仕組みを理解する上で知っておきたい基礎知識/auth-overview
nishina555
1
170
REST APIとの比較でざっくり理解するGraphQL/graphql-introduction
nishina555
0
170
ウィンドウ操作に便利な ショートカットとアプリ紹介/mac-window-shortcut
nishina555
0
130
図で理解する自然言語処理/nlp_tutorial
nishina555
0
210
ToDoアプリで学ぶReact/Redux入門/vtecx2_lt2
nishina555
2
2.8k
DiveIntoOSSThroughHacktoberfest_SPMKT
nishina555
1
300
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
CSC509 Lecture 13
javiergs
PRO
0
110
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Contemporary Test Cases
maaretp
0
140
CSC509 Lecture 12
javiergs
PRO
0
160
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
620
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Unsuck your backbone
ammeep
668
57k
Raft: Consensus for Rubyists
vanstee
136
6.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
Visualization
eitanlees
145
15k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
What's in a price? How to price your products and services
michaelherold
243
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Transcript
ਔՊढ़ 2018/03/26 ʙ Ϋϥεྨ͔ΒαϒωοτϚεΫ·Ͱ ʙ IPΞυϨε(IPv4)ͷΈ
αʔϏεΛӡӦ͢ΔաఔͰωοτϫʔΫΛ੍ݶ͢Δػձଟ͍ ։ൃڥΛ֎෦͔ΒΞΫηεͰ͖ͳ͍Α͏ʹ͢ΔͨΊ ֎෦͔Βͷ߈ܸΛ͙ͨΊ ͳͥࠓIPΞυϨεʁ IPΞυϨεΛֶͿ͜ͱͰωοτϫʔΫͷӨڹൣғͳͲΛਖ਼͘͠ ཧղ͢Δ͜ͱ͕Ͱ͖Δ
IPΞυϨεͷ֓ཁ Ϋϥεʹ͍ͭͯ αϒωοτʹ͍ͭͯ ·ͱΊ ࣍
IPΞυϨεͷ֓ཁ
32ܻͷ0ɾ1ͷΈ߹Θͤ(2ਐ)ͰΓཱ͍ͬͯΔ 8Ϗοτ1ͱ͠ɺ4Έʹ͚ͯ10ਐͰදࣔͯ͠ਓͰ Θ͔Γ͍͢ܗͰදݱ͞Ε͍ͯΔ IPΞυϨεʹ͍ͭͯ 10000110 11101010 00000000 00000001 134
.234 .0 .1 2ਐ 10ਐ
ੈքతʹIANA(ICANN)Ͱ Ұݩཧ ຊࠃJPNIC͕ IPΞυϨεΛৼΓ͚͍ͯΔ ࠃϓϩόΠμͰར༻Ͱ͖Δ IPΞυϨεͷൣғܾ·͍ͬͯΔ IPΞυϨεͷৼΓ͚ํ IUUQTXXXDNBOKQOFUXPSLTVQQPSU*1@MJTUIUNM
ωοτϫʔΫ෦ͱϗετ෦ʹ͔Ε͓ͯΓɺ ʮͲͷωοτϫʔΫͷͲͷίϯϐϡʔλ͔ʯΛࣝผ͍ͯ͠Δ IPΞυϨεͷઌ಄͔ΒωοτϫʔΫ෦ ɾϗετ෦ͷॱ൪Ͱܻ͕ ׂΓৼΒΕΔɻ ωοτϫʔΫ෦ͱϗετ෦ͷڥքIPΞυϨεͷޙΖͷ”/“Ͱදݱ IPΞυϨεͷߏ 10000110 11101010
00000000 00000001 ϗετ෦ ωοτϫʔΫ෦ 134.234.0.1/16ͷ߹ 16ܻ 134.234ͷωοτϫʔΫͷ0.1ͱ͍͏ϗετ
ωοτϫʔΫ෦ͱϗετ෦ͷϧʔϧ (1/2) 134.234.0.1/16 134.234.0.2/16 134.234.0.3/16 134.235.xxx.xxx 134.234.xxx.xxx Πϯλʔωοτ ωοτϫʔΫ
ωοτϫʔΫ෦ωοτϫʔΫ͕ҧ͏߹ҧ͏Ͱͳ͚Ε͍͚ͳ͍
ωοτϫʔΫ෦ͱϗετ෦ͷϧʔϧ (2/2) 134.234.0.1/16 134.234.0.2/16 134.234.0.3/16 134.235.xxx.xxx 134.234.xxx.xxx Πϯλʔωοτ ϗετ෦ಉ͡ωοτϫʔΫͰ͋Εҧ͏Ͱͳ͍ͱ͍͚ͳ͍
ϗετ
શͯ0Ͱදݱ ϗετ෦ͯ͢Λࣔ͢ΞυϨε(= ωοτϫʔΫࣗΛࣔ͢) ωοτϫʔΫΞυϨε ϗετ෦ͷಛผͳΞυϨε(1/2) ྫ. 134.234.0.0/16 134.234.0.1 -
134.234.255.254ͷϗετ͕ଘࡏ͢Δ ωοτϫʔΫͷ͜ͱ 134.234.xxx.xxxͷωοτϫʔΫͷ͜ͱ
શͯ1Ͱදݱ ϗετ෦ͯ͢Λࣔ͢ શϗετʹಉҰͷ༰Λૹ৴͢Δͱ͖ͳͲʹར༻ ϒϩʔυΩϟετΞυϨε ϗετ෦ͷಛผͳΞυϨε(2/2) ྫ. 134.234.255.255 134.234.0.1 -
134.234.255.254ͷϗετશͯΛࢦ͢
ϩʔΧϧωοτϫʔΫͰׂΓͯΔ͜ͱͷͰ͖ΔΞυϨεͷ͜ͱ ϓϥΠϕʔτΞυϨεͱͯ͑͠ΔIPΞυϨεܾ·͍ͬͯΔ 10.0.0.1 ʙ10.255.255.254 (10.0.0.0/8) 172.16.0.1 ʙ172.31.255.254 (172.16.0.0/16) 192.168.0.1 ʙ192.168.255.254
(192.168.0.0/24) ϓϥΠϕʔτΞυϨε IPΞυϨεΛϗετ͝ͱͰͳ͘ωοτϫʔΫʹׂΓͯΔ͜ͱͰ ωοτϫʔΫؒͷϗετͰIPΛڞ༗͠ɺ4294967296(2ͷ32)Ҏ্ ͷίϯϐϡʔλʔ͕ΠϯλʔωοτΛར༻͢Δ͜ͱ͕Ͱ͖Δ
άϩʔόϧΞυϨεͱϓϥΠϕʔτΞυϨε 134.234.0.1 134.234.0.2 134.234.0.3 134.234.xxx.xxx 172.16.0.1 172.16.0.2 172.16.0.2 172.16.0.0
172.16.0.4 172.16.0.5 172.16.0.6 άϩʔόϧΞυϨε ϓϥΠϕʔτΞυϨε ϓϥΠϕʔτΞυϨεʹΑΓωοτϫʔΫ୯ҐͰάϩʔόϧΞυϨεΛڞ༗
ϓϥΠϕʔτΞυϨεͷܾ·Γ 134.234.0.1 134.234.0.2 134.234.0.3 134.234.xxx.xxx 172.16.0.1 172.16.0.2 172.16.0.3 172.16.0.0
172.16.0.1 172.16.0.2 172.16.0.3 172.16.0.0 ωοτϫʔΫ͕ҟͳΕϓϥΠϕʔτΞυϨεಉ͡Ͱྑ͍
Ϋϥεʹ͍ͭͯ
IPΞυϨεͷΫϥε IPΞυϨεωοτϫʔΫ෦ͱϗετ෦ͷΓ͚ํʹΑͬͯ ωοτϫʔΫͷن͕ҟͳΔ ωοτϫʔΫͷنʹΑͬͯIPΞυϨεΫϥεʹྨ͞ΕΔ ΫϥεʹΑͬͯར༻Ͱ͖ΔIPΞυϨε͕ܾ·͍ͬͯΔ (ͨͩ͠ɺࠓαϒωοτϚεΫ͕ಋೖ͞ΕͯॊೈʹIPΞυϨεΛ ར༻Ͱ͖ΔΑ͏ʹͳ͍ͬͯΔ)
Ϋϥεͷৄࡉ ΫϥεA ΫϥεB ΫϥεC ωοτϫʔΫن େن͚ தن͚ খن͚ ωοτϫʔΫ෦
্ҐϏοτ ্ҐϏοτ ্ҐϏοτ ωοτϫʔΫ ͷ ͷ ͷ ϗετ෦ ԼҐϏοτ ԼҐϏοτ ԼҐϏοτ ϗετ ͷ ͷ ͷ άϩόʔϧΞυϨε ʙ ʙ ʙ ϓϥΠϕʔτΞυϨε ʙ ʙ ʙ
αϒωοτʹ͍ͭͯ
ن͕େ͖͗ͣ͢খ͗͢͞ͳ͍ΫϥεBʹूத Ϋϥε͝ͱʹར༻Ͱ͖ΔIPΞυϨε͕ܾ·͍ͬͯΔͨΊ IPΞυϨε͕ෆ͢Δ ར༻͢ΔΫϥε͕ूத͢Δ ΫϥεBϗετ͕65,534ઃఆͰ͖Δ͕ݱ࣮తͰͳ͍ ϗετ͕༨ͬͨ݁ՌωοτϫʔΫ্ͰIPΞυϨε͕༨ͬͯ͠·͏ ϗετ͕ແବʹ༨Δ Ϋϥεͷ
αϒωοτϚεΫ ΫϥεʹറΒΕΔ͜ͱͳ͘ωοτϫʔΫ෦ͱϗετ෦ʹ͚ΒΕΔ Α͏ʹ͢Δࣝผࢠͷ͜ͱ ωοτϫʔΫ෦Λ1, ϗετ෦Λ0ͱ͢Δ ϓϨϑΟοΫεه๏ɺCIDR(Classless Inter-Domain Routing) Λར༻͢ΔࣄͰԿϏοτ͕ωοτϫʔΫ෦ͳͷ͔͕Θ͔Δɻ
αϒωοτϚεΫʹΑͬͯྨ͞ΕͨΫϥεωοτϫʔΫΛ αϒωοτͱ͍͏
αϒωοτͷ۩ମྫ 10101100 00010100 00000000 00000000 ϗετ෦ ωοτϫʔΫ෦ 172.20.0.0/16 16ܻ
Ϋϥεͷ߹ 10101100 00010100 00000000 00000000 ϗετ෦ ωοτϫʔΫ෦ 172.20.0.0/24 24ܻ αϒωοτͷ߹ 10101100 00010100 111111111 00000000 ϗετ෦ ωοτϫʔΫ෦ 172.20.1.0/24 24ܻ
IPΞυϨεͱαϒωοτϚεΫͷରԠ 10101100 00010100 00000000 00000000 ϗετ෦ ωοτϫʔΫ෦ 172.20.0.0/24 24ܻ
IPΞυϨε 111111111 111111111 111111111 00000000 ϗετ෦ ωοτϫʔΫ෦ 255.255.255.0 24ܻ αϒωοτϚεΫ ɾωοτϫʔΫ෦Λ1, ϗετ෦Λ0Ͱදݱͨ͠2ਐΛ10ਐʹ͢Δ ͱαϒωοτϚεΫͷͱͳΔ ɾαϒωοτϚεΫΛݟΕωοτϫʔΫͷن͕Θ͔Δɻ
(࠶ܝ) ΫϥεʹΑΔωοτϫʔΫ 134.234.0.1 134.234.0.2 134.234.0.3 134.234.xxx.xxx 172.16.0.1 172.16.0.2 172.16.0.3
172.16.0.0/16 172.16.0.4 172.16.0.5 172.16.0.6
αϒωοτϚεΫʹΑΓαϒωοτԽ͞ΕͨωοτϫʔΫ 134.234.0.1 134.234.0.2 134.234.0.3 134.234.xxx.xxx 172.16.0.0/24 172.16.0.1/24 172.16.0.2/24 172.16.0.3/24
172.16.1.0/24 172.16.1.1/24 172.16.1.2/24 172.16.1.3/24
·ͱΊ
IPΞυϨεʹ άϩʔόϧΞυϨεͱϓϥΠϕʔτΞυϨε͕͋Δ ϗετ෦͕શͯ0ͷͷωοτϫʔΫΞυϨε ϗετ෦͕શͯ1ͷͷϒϩʔυΩϟετΞυϨε ݩʑIPΞυϨεA, B, CͷΫϥεΛ͓࣋ͬͯΓɺ ࠓαϒωοτʹΑͬͯαϒωοτԽ͞Ε͍ͯΔ CIDR(/xx)ΛΈΔ͜ͱͰωοτϫʔΫͷنɺ ϗετ͕Θ͔Δɻ͕গͳ͍΄Ͳϗετଟ͍
·ͱΊ