networking

IP Subnetting

  • Devops

Something you need to know first: Binary Odometer

10.1.1.254 + 1 = 10.1.1.255
10.1.1.255 + 1 = 10.1.2.0
10.1.2.0 + 1 = 10.1.2.1

in reverse:

10.1.2.0 – 1 = 10.1.1.255

Example 1

172.16.35.123/20 or 172.16.35.123 with the mask 255.255.240.0

Binary Method

image alt

Quick Method

Figure out the subnets:

  1. network and host split in third octect
  2. subtract: 256 – 240 = 16, it means that network are incrementing in values of 16: 0, 16, 32, 48…
  3. 35 in the range of 32 and 48, so 172.16.35.123 is on subnet 172.16.32.0; next subnet is 172.16.48.0

First subnet = 172.16.32.0

Next subnet = 172.16.48.0

Broadcast address = next subnet – 1

First host = Subnet + 1

Last host = Broadcast – 1

Subnetting

  • Class A subnetting (255.0.0.0) support 1677214 (2^24) host per network, that way too much
  • Class B subnetting (255.255.0.0) support 16382 (2^16) host per network, that way too much
  • Class C subnetting (255.255.255.0) support 254 (2^8) host, more likely we subnet down to at least 254 hosts or even further

If you subnetting a network only has 2 hosts, you can subnet with (255.255.255.254) or CIDR as /31

Network, host number

  • Networks: 2^(network bits)
    • one allocate for the subnet
    • one allocate for the broadcast
  • Hosts: 2^(host bits) – 2

Subnetting to be short

  1. “stealing” or “taking away” bits from the host portion of an address, and
  2. allocating those bits to network portion

Example 2

Origin network 10.128.192.0/18 need at least 30 subnets as many hosts as possible

image

  1. draw the line with /18 to split network and host
  2. 2^5 > 30, need 5 subnet bit, draw the line to split subnet and host
  3. network/subnet portion is 8+8+7=23 bits, host portion is 32-23=9 bits
  • First subnet: 10.128.192.0/23
  • Second subnet: 10.128.194.0/23
  • Last subnet: 10.128.254.0/23

IP Addressing

  • Devops
tags: ccna

IP Addressing

  • layer 3 logical address assigned by an administrator(MAC built in NIC)
  • used to identify specific devices on a network
  • every device on the internet has a unique IP Address

Street Analogy

  • network address portion
    • identifies a specific network
    • routers route traffic via routing tables, is based on network address(Network ID), not ip address
  • host address portion
    • identifies a specific endpoint on a network
    • we can use a protocal such as ARP to find the host

Ipv4

  • connectionless protocal: no sessions formd when transmitted, no status info
  • packets treated independently
    • may take different paths: load balancing, bandwidth, hopcount
  • hierarchical addressing sturture
  • best effort delivery
  • format
    • 32 bit with 4 octets
    • like DHL or FedEx routing parcel based on an address

Classes

  • Unicast Traffic
    • A
      • start with binary 0
      • range from 0(00000000).0.0.0 to 127(01111111).255.255.255
      • exceptions:
        • 127 is reserved for loopback: 127.0.0.1
        • 0 network is reserved for default network: 0.1.1.1
      • actual range from 1.0.0.0 to 126.255.255.255
      • portions
        • first 1 octets: Networks
        • last 3 octests: Hosts
    • B
      • start with binary 10
      • range from 128(10000000).0.0.0 to 191(10111111).255.255.255
      • portions
        • first 2 octets: Networks
        • last 2 octests: Hosts
    • C
      • start with binary 110
      • range from 192(11000000).0.0.0 to 223(11011111).255.255.255
      • portions
        • first 3 octets: Networks
        • last 1 octests: Hosts
  • Multicast
    • D
      • start with binary 111
  • reserved for other purposes
    • E
      • start with binary 1111

These classes replaced by Classless Inter-Domain Routing(CIDR) in 1993

Read More »IP Addressing

OSI Model

  • Devops
tags: ccna

OSI Model

  • By International Organization of Standard

Benefits

  • Standard and INTEROPERABILITY
  • Split development/role: hide developer from lower layer
  • Quicker development

Layers

You need to remember both the name and the layer number

  • Layer7: Application
  • Layer6: Presentation
  • Layer5: Session
  • Layer4: Transport
  • Layer3: Network
  • Layer2: DataLink
  • Layer1: Physical

Trick: All People Sleeping Through Networking Don’t Pass

Network Engineer: Focus on 1, 2, 3, 4 Layers
Web Developer: Focus on 5, 6, 7 Layers

Read More »OSI Model