IPv4 notes

Table of Contents

Historical Classes of networks

ClassLeading bitsRangeSubnet/Classful/Natural mask
A00.0.0.0 - 127.255.255.255
Cisco says 126.x.x.x
- 127.0.0.1 used for local loopback
255.0.0.0
B10128.0.0.0 - 191.255.255.255255.255.0.0
C110192.0.0.0 - 223.255.255.255255.255.255.0
D (multicast)1110224.0.0.0 - 239.255.255.255
224.0.1.0-238.255.255.255 are global scoped - can be used across Internet
E (reserved)1111240.0.0.0 - 255.255.255.255 

Unicast

One to one traffic

Assigning

Broadcast

255.255.255.255 everywhere on our subnet
192.168.100.255/24 local subnet/directed broadcast on any subnet

Multicast

224-229.X.X.X
endpoints join a group (e.g. group with addr 239.1.2.3)

Registered multicast addrs

224.0.0.0  Base Address (Reserved)                  [RFC1112][JBP]
224.0.0.1  All Systems on this Subnet               [RFC1112][JBP]
224.0.0.2  All Routers on this Subnet                        [JBP]
224.0.0.3  Unassigned                                        [JBP]
224.0.0.4  DVMRP    Routers                         [RFC1075][JBP]
224.0.0.5  OSPFIGP  OSPFIGP All Routers            [RFC2328][JXM1]
224.0.0.6  OSPFIGP  OSPFIGP Designated Routers     [RFC2328][JXM1]
224.0.0.7  ST Routers                              [RFC1190][KS14]
224.0.0.8  ST Hosts                                [RFC1190][KS14]
224.0.0.9  RIP2 Routers                           [RFC1723][GSM11]
224.0.0.10 IGRP Routers                                [Farinacci]
224.0.0.11 Mobile-Agents                            [Bill Simpson]
224.0.0.12 DHCP Server / Relay Agent                     [Unknown]
224.0.0.13 All PIM Routers                             [Farinacci]
...
See http://www.iana.org/assignments/multicast-addresses/ for a complete list.

Overview of how multicast works

Quoted from http://www.cisco.com/en/US/tech/tk828/technologies_white_paper09186a0080092942.shtml.
  1. The client sends an IGMP join message to its designated multicast router. The destination MAC address maps to the Class D address of group being joined, rather being the MAC address of the router. The body of the IGMP datagram also includes the Class D group address.
  2. The router logs the join message and uses PIM or another multicast routing protocol to add this segment to the multicast distribution tree.
  3. IP multicast traffic transmitted from the server is now distributed via the designated router to the client's subnet. The destination MAC address corresponds to the Class D address of group
  4. The switch receives the multicast packet and examines its forwarding table. If no entry exists for the MAC address, the packet will be flooded to all ports within the broadcast domain. If a entry does exist in the switch table, the packet will be forwarded only to the designated ports.
  5. With IGMP V2, the client can cease group membership by sending an IGMP leave to the router. With IGMP V1, the client remains a member of the group until it fails to send a join message in response to a query from the router. Multicast routers also periodically send an IGMP query to the "all multicast hosts" group or to a specific multicast group on the subnet to determine which groups are still active within the subnet. Each host delays its response to a query by a small random period and will then respond only if no other host in the group has already reported. This mechanism prevents many hosts from congesting the network with simultaneous reports.

subnet

network addr 172.16.0.0 255.255.224.0 or /19 subnet
directed broadcast 172.16.31.255 (1s for host bits)
usable ip addrs 172.16.0.1 - 172.16.31.254

Private IP ranges (RFC1918)

10.0.0.0        -   10.255.255.255  (10/8)         def subnet mask 255.0.0.0
172.16.0.0      -   172.31.255.255  (172.16/12)    def subnet mask 255.255.0.0
192.168.0.0     -   192.168.255.255 (192.168/16)   def subnet mask 255.255.255.0

link-local/self assigned address

169.254.0.0     -   169.254.255.255  (169.254/16)  def subnet mask 255.255.0.0
APIPA (Auto Priv IP Addressing) 0 non-routable addr assigned to a host that did not hav ip addr manually or dynamically assigned

TEST-NET Addresses

192.0.2.0 - 192.0.2.255 (192.0.2.0 /24)

VLSM/CIDR

IP Packet - (RFC791)

 
    0                   1                   2                   3   
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Version4|  IHLInternet Header Length is
the length of the internet
header in 32 bit words,
and thus points to the
beginning of the data.
Note that the minimum
value for a correct header
is 5 32-bit words.
|Type of Service| Total Lengthentire packet size,
including header and data,
in bytes
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IdentificationIDs fragments for
reassembly
|FlagsBit 1 - Do Not Frag (1)
Bit 2 - More Frags (1)
| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Livenum of hops until pkt
is dropped. Keeps routing
loops from happening.
| Protocole.g.
  • 01 ICMP
  • 06 TCP
  • 17 UDP
| Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+