title: S1E2 - IPv4 Addressing |
author: Nicholas Morrison nick@nanocat.net |
draft: false |
tags: [network, workshop, arista] |
categories: [workshop] |
noindex: true |
OSI = Open Systems Interconnection
Standard of the ISO (International Organisation for Standardization): https://www.iso.org/about-us.html
Download it from here: https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html
(search for the string “7498-1:1994
”)
” 6.1.4. The highest is the Application Layer and it consists of the application-entities that cooperate in the OSI Environment. The lower layers provide the services through which the application entities cooperate.
6.1.5. Layers 1-6, together with the physical media for OSI provide a step-by-step enhancement of communication services. The boundary between layers identifies a stage in this enhancement process at which an OSI service standard is defined while the functioning of the layers is governed by OSI protocol standards. ”
Layer 7: Application HTTP, HTTPS, IMAP, WebSockets
Layer 6: Presentation MIME, SSL/TLS, ASCII, MPEG
Layer 5: Session TCP Sockets, named pipes, RPC
Layer 4: Transport TCP, UDP, GRE, ESP
Layer 3: Network IP, ICMP, IPSEC, OSPF, RIP
Layer 2: Data Link ARP, VLAN (802.1q), PPP, IS-IS
Layer 1: Physical RJ45, RS-232, 802.3 PHY (10BASE-T,
100BASE-T, 1000BASE-T), DOCSIS,
DWDM
apt install bc
/
brew install bc
)$ echo "obase=2;192" | bc
11000000
$ echo "ibase=2;11000000" | bc
192
$
11000000.10101000.00000000.00000001
except converted to decimal:
192. 168. 0. 1
3232235521
IPv4 addresses: 32 bits long
32 bits = 4,294,967,295 combinations of on or off, 1 or 0
=> only 4,294,967,295 IPv4 addresses (minus reservations)
… but we have more devices than that
tricks for sharing IPv4 addresses: NAT (Network Address Translation)
IPv6 addresses: 128 bits long
128 bits = 340,282,366,920,938,463,463,374,607,431,768,211,456 (340 trillion trillion trillion) combinations of on or off
=> 340,282,366,920,938,463,463,374,607,431,768,211,456 IPv6 addresses
There are maybe 400 billion stars in the milky way.
192.168.0.1 255.255.255.0
or,
192.168.0.1/24
255.255.255.0 = 11111111.11111111.11111111.00000000
Same “network” part => communicate directly, no Router
Different “network” part => must use a Router to communicate
No gaps allowed in the bits in the network mask!
203 . 33 . 18 . 1 /24
11001011.00100001.00010010.00000001 /24
203 . 33 . 18 . 0 /24
11001011.00100001.00010010.00000000 /24
========.========.======== <= network part, written as 203.33.18.0/24
203 . 33 . 18 . 1 /24
11001011.00100001.00010010.00000001 /24
======== <= host part, written as 203.33.18.1/24
192 . 168 . 56 . 43 /16
11000000.10101000.00111000.00101011 /16
192 . 168 . 0 . 0 /16
11000000.10101000.00000000.00000000 /16
========.======== <= network part, written as: 192.168.0.0/16
192 . 168 . 56 . 43 /16
11000000.10101000.00111000.00101011 /16
========.======== <= host part, written as: 192.168.56.43/16
150 . 101 . 5 . 6 /23
10010110.01100101.00000101.00000110 /23
150 . 101 . 4 . 0 /23
10010110.01100101.00000100.00000000 /23
========.========.======= <= network part, written as 150.101.4.0/23
150 . 101 . 5 . 6 /23
10010110.01100101.00000101.00000110 /23
=.======== <= network part, written as 150.101.5.6/23
ip a
ipconfig
ifconfig
What is your local IP address?
What is your network mask?
How many unique IP addresses are available in your local network?
linux: ip a
| windows: ipconfig
| macos:
ifconfig
Handy tool: ipcalc