Network Cheatsheet

###############################################################################

Netmask              Netmask (binary)                 CIDR     Notes    
_____________________________________________________________________________
255.255.255.255  11111111.11111111.11111111.11111111  /32  Host (single addr)
255.255.255.254  11111111.11111111.11111111.11111110  /31  Unuseable
255.255.255.252  11111111.11111111.11111111.11111100  /30    2  useable
255.255.255.248  11111111.11111111.11111111.11111000  /29    6  useable
255.255.255.240  11111111.11111111.11111111.11110000  /28   14  useable
255.255.255.224  11111111.11111111.11111111.11100000  /27   30  useable
255.255.255.192  11111111.11111111.11111111.11000000  /26   62  useable
255.255.255.128  11111111.11111111.11111111.10000000  /25  126  useable
255.255.255.0    11111111.11111111.11111111.00000000  /24 "Class C" 254 useable

255.255.254.0    11111111.11111111.11111110.00000000  /23    2  Class C's
255.255.252.0    11111111.11111111.11111100.00000000  /22    4  Class C's
255.255.248.0    11111111.11111111.11111000.00000000  /21    8  Class C's
255.255.240.0    11111111.11111111.11110000.00000000  /20   16  Class C's
255.255.224.0    11111111.11111111.11100000.00000000  /19   32  Class C's
255.255.192.0    11111111.11111111.11000000.00000000  /18   64  Class C's
255.255.128.0    11111111.11111111.10000000.00000000  /17  128  Class C's
255.255.0.0      11111111.11111111.00000000.00000000  /16  "Class B"
     
255.254.0.0      11111111.11111110.00000000.00000000  /15    2  Class B's
255.252.0.0      11111111.11111100.00000000.00000000  /14    4  Class B's
255.248.0.0      11111111.11111000.00000000.00000000  /13    8  Class B's
255.240.0.0      11111111.11110000.00000000.00000000  /12   16  Class B's
255.224.0.0      11111111.11100000.00000000.00000000  /11   32  Class B's
255.192.0.0      11111111.11000000.00000000.00000000  /10   64  Class B's
255.128.0.0      11111111.10000000.00000000.00000000  /9   128  Class B's
255.0.0.0        11111111.00000000.00000000.00000000  /8   "Class A"
  
254.0.0.0        11111110.00000000.00000000.00000000  /7
252.0.0.0        11111100.00000000.00000000.00000000  /6
248.0.0.0        11111000.00000000.00000000.00000000  /5
240.0.0.0        11110000.00000000.00000000.00000000  /4
224.0.0.0        11100000.00000000.00000000.00000000  /3
192.0.0.0        11000000.00000000.00000000.00000000  /2
128.0.0.0        10000000.00000000.00000000.00000000  /1
0.0.0.0          00000000.00000000.00000000.00000000  /0   IP space

For wildcard netmasks (aka reverse netmasks), subtract each octet of a standard netmask from 255.
  Example 1: 255.255.255.0 becomes 0.0.0.255
  Example 2: 255.255.252.0 becomes 0.0.3.255

###############################################################################

                                   Net     Host    Total
Net      Addr                      Addr    Addr    Number
Class   Range      NetMask         Bits    Bits   of hosts
----------------------------------------------------------
A        0-127    255.0.0.0         8      24     16777216   (i.e. 114.0.0.0)
B      128-191    255.255.0.0      16      16        65536   (i.e. 150.0.0.0)
C      192-254    255.255.255.0    24       8          256   (i.e. 199.0.0.0)
D      224-239    (multicast)
E      240-255    (reserved)
F      208-215    255.255.255.240  28       4           16
G      216/8      ARIN - North America
G      217/8      RIPE NCC - Europe
G      218-219/8  APNIC
H      220-221    255.255.255.248  29       3            8   (reserved)
K      222-223    255.255.255.254  31       1            2   (reserved)
(ref: RFC1375 & http://www.iana.org/assignments/ipv4-address-space )
(               http://www.iana.org/numbers.htm                    )
----------------------------------------------------------

###############################################################################
* Reserved IP Addresses

Private Network Address Ranges
IP Range         # Addresses
10.0.0.0/8        16,777,216  
172.16.0.0/12      1,048,576 
192.168.0.0/16        65,536 

Local Address Ranges
IP Range         # Addresses    Notes
0.0.0.0/8         16,777,216    For broadcast messages to current network
127.0.0.0/8       16,777,216    For loopback addresses to local host
169.254.0.0/16        65,536    For autoconfiguration between 2 hosts on a single link

Address Ranges for Documentation and Example Code
IP Range         # Addresses
192.0.2.0/24             256 
198.51.100.0/24          256
203.0.113.0/24           256

Special-Purpose Address Ranges
IP Range         # Addresses    Notes
100.64.0.0/10      4,194,304    New in 2012! For carrier-grade NAT, but may be used for private networks
192.0.0.0/29               8    For DS-Lite transition mechanism
192.88.99.0/24           256    For 6to4 anycast relays
198.18.0.0/15        131,072    For benchmark tests of routers
224.0.0.0/4      268,435,456    For multicast
240.0.0.0/4      268,435,455    For future use
255.255.255.255/32         1    For limited broadcast

See https://tools.ietf.org/html/rfc5735 (covers 15 of the 16 reserved networks)
See https://tools.ietf.org/html/rfc6598 (covers the new kid on the block, 100.64.0.0/10)
See http://en.wikipedia.org/wiki/Reserved_IP_addresses


###############################################################################
* Martians: (updates at: www.iana.org/assignments/ipv4-address-space )

http://en.wikipedia.org/wiki/Martian_packet
http://en.wikipedia.org/wiki/Bogon_filtering

 no ip source-route
 access-list 100 deny   ip host 0.0.0.0 any
  deny ip 0.0.0.0         0.255.255.255  any log  ! antispoof
  deny ip 0.0.0.0 0.255.255.255  0.0.0.0 255.255.255.255 ! antispoof
  deny ip any             255.255.255.128 0.0.0.127 ! antispoof
  deny ip host            0.0.0.0        any log  ! antispoof
  deny ip host            [router intf]  [router intf] ! antispoof
  deny ip xxx.xxx.xxx.0   0.0.0.255      any log  ! lan area
  deny ip 0/8             0.255.255.255  any log  ! IANA - Reserved
  deny ip 1/8             0.255.255.255  any log  ! IANA - Reserved
  deny ip 2/8             0.255.255.255  any log  ! IANA - Reserved
  deny ip 5/8             0.255.255.255  any log  ! IANA - Reserved
  deny ip 7/8             0.255.255.255  any log  ! IANA - Reserved
  deny ip 10.0.0.0        0.255.255.255  any log  ! IANA - Private Use
  deny ip 23/8            0.255.255.255  any log  ! IANA - Reserved
  deny ip 27/8            0.255.255.255  any log  ! IANA - Reserved
  deny ip 31/8            0.255.255.255  any log  ! IANA - Reserved
  deny ip 36-37/8         0.255.255.255  any log  ! IANA - Reserved
  deny ip 39/8            0.255.255.255  any log  ! IANA - Reserved
  deny ip 41-42/8         0.255.255.255  any log  ! IANA - Reserved
  deny ip 50/8            0.255.255.255  any log  ! IANA - Reserved
  deny ip 58-60/8         0.255.255.255  any log  ! IANA - Reserved
  deny ip 69-79/8         0.255.255.255  any log  ! IANA - Reserved
  deny ip 82-95/8         0.255.255.255  any log  ! IANA - Reserved
  deny ip 96-126/8        0.255.255.255  any log  ! IANA - Reserved
  deny ip 127/8           0.255.255.255  any log  ! IANA - Reserved
  deny ip 169.254.0.0     0.0.255.255    any log  ! link-local network
  deny ip 172.16.0.0      0.15.255.255   any log  ! reserved
  deny ip 192.168.0.0     0.0.255.255    any log  ! reserved
  deny ip 192.0.2.0       0.0.0.255      any log  ! test network
  deny ip 197/8           0.255.255.255  any log  ! IANA - Reserved
  deny ip 220/8           0.255.255.255  any log  ! IANA - Reserved
  deny ip 222-223/8       0.255.255.255  any log  ! IANA - Reserved
  deny ip 224.0.0.0       31.255.255.255 any log  ! multicast
  deny ip 224.0.0.0       15.255.255.255 any log  ! unless MBGP-learned routes
  deny ip 224-239/8       0.255.255.255  any log  ! IANA - Multicast
  deny ip 240-255/8       0.255.255.255  any log  ! IANA - Reserved

###############################################################################
* IP Address Blocks ARIN Issues From (https://www.arin.net/knowledge/ip_blocks.html)

   23.0.0.0/8
   24.0.0.0/8
   50.0.0.0/8
   63.0.0.0/8
   64.0.0.0/8
   65.0.0.0/8
   66.0.0.0/8
   67.0.0.0/8
   68.0.0.0/8
   69.0.0.0/8
   70.0.0.0/8
   71.0.0.0/8
   72.0.0.0/8
   73.0.0.0/8
   74.0.0.0/8
   75.0.0.0/8
   76.0.0.0/8
   96.0.0.0/8
   97.0.0.0/8
   98.0.0.0/8
   99.0.0.0/8
  100.0.0.0/8
  104.0.0.0/8
  107.0.0.0/8
  108.0.0.0/8
  135.0.0.0/8
  136.0.0.0/8
  142.0.0.0/8
  147.0.0.0/8
  162.0.0.0/8
  166.0.0.0/8
  172.0.0.0/8
  173.0.0.0/8
  174.0.0.0/8
  192.0.0.0/8
  198.0.0.0/8
  199.0.0.0/8
  204.0.0.0/8
  205.0.0.0/8
  206.0.0.0/8
  207.0.0.0/8
  208.0.0.0/8
  209.0.0.0/8
  216.0.0.0/8

###############################################################################
* Well known ports: (rfc1700.txt)

 www.iana.org/assignments/port-numbers

protocol numbers:
 www.iana.org/assignments/protocol-numbers
 www.iana.org/numbers.htm

Protocol     Protocol Number
--------     ---------------
ICMP		1
IGRP		9
EIGRP		88
OSPF		89
IPv6		41
GRE		47
IPX in IP	111
L2TP		115

###############################################################################
* Wireless (See http://en.wikipedia.org/wiki/IEEE_802.11)

Protocol  Year	Frequency	Data Rate per stream	Allowable # Streams	Indoor Range	Outdoor Range
-         1997	2.4 GHz		1-2 Mb/s		1 stream		66 feet		330 feet
a         1999	5 GHz		6-54 Mb/s		1 stream		115 feet	380 feet
b         1999	2.4 GHz		1-11 Mb/s		1 stream		115 feet	460 feet
g         2003	2.4 GHz		6-54 Mb/s		1 stream		125 feet	460 feet
n         2009	2.4/5 GHz	7-150 Mb/s		4 streams		230 feet	820 feet
ac        2012	5 GHz		max 867 Mb/s		8 streams		?		?
ad        2014	2.4/5/60 GHz	?			?			?		?

###############################################################################