S1E2 - IPv4 Addressing

title: S1E2 - IPv4 Addressing
author: Nicholas Morrison
draft: false
tags: [network, workshop, arista]
categories: [workshop]
noindex: true

IP: Internet Protocol

The OSI Layer Model (in short)

Quoting the standard

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

The Seven OSI Layers

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

Tools for converting between bases

$ echo "obase=2;192" | bc
11000000
$ echo "ibase=2;11000000" | bc
192
$

IP Addresses

   11000000.10101000.00000000.00000001

except converted to decimal:

   192.     168.     0.       1
        3232235521

IPv4 and IPv6

Network Masks 1

        192.168.0.1   255.255.255.0

or,

        192.168.0.1/24
        255.255.255.0 = 11111111.11111111.11111111.00000000

Network Masks 2

IP Address Example: 203.33.18.1/24

   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

IP Address Example: 192.168.56.43/16

   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

IP Address Example: 150.101.5.6/23

   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

Finding your own IP address(es)

Questions

linux: ip a | windows: ipconfig | macos: ifconfig

Handy tool: ipcalc