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.0.0.0(00000000) to 127.255.255.255(01111111)
      • 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.0.0.0(10000000) to 191.255.255.255(10111111)
      • portions
        • first 2 octets: Networks
        • last 2 octests: Hosts
    • C
      • start with binary 110
      • range from 192.0.0.0(11000000) to 223.255.255.255(11011111)
      • 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

Special Address

  • Directed Broadcast Address
    • host sends data to all device on a specific network
    • binarys 1s in the entire host portion
    • routers can route directed broadcast, disabled by default
    • Denial of service attack(DDoS)
  • Local Broadcast Address
    • communicate with all device on local network
    • address is all binary 1 (255.255.255.255)
    • e.g. host requrest an IP address from an DHCP Server(Dynamic Host Configuration Protocal)
    • always dropped by routers, configuring DHCP forwarding or DHCP relay
  • Local Loopback Address
    • let a system send a message to itself for testing
    • to make sure that the TCP/IP stack is correctly installed
    • typical use 127.0.0.1 with IPv4
      • class A
      • anything in 127 range is deemd as loopback address: 16 million ip wasted
    • also have IPv6 loopback suchas ::1, resolve the IPv4 wasted.
    • routers and switchers can also be configured with a IP address on a loopback interface, which are not the same as local loopback address

Private Address

See RFC1918

  • 1 class A networks
  • 16 class B networks
  • 256 class C networks
  • Microsoft IPv4 Link Local Address

See RFC3927

  • Automactic Private IP Address (APIPA)
  • PC automatically chooses an IP address in range 169.254.0.0/16 with no DHCP
  • can immediately communicate using IP without configuration: only on LOCAL LINK
  • non routable

Subnet Masks

  • to determin the portion of address which is host and network
    • Remote: different sebnet, reached via a default gateway
    • Local: same subnet, communicate on local segment directly, does not require a default gateway

Class A, B and C have default masks:

  • Class A: 255.0.0.0
  • Class B: 255.255.0.0
  • Class C: 255.255.255.0

Two simple rules, any address bits have corresponding mask bit:

  • set to 1: represent the NETWORK ID
  • set to 0: represent the HOST ID

To work out if another host is local or remote

  • check network portion
  • compare to the other host

Subnet mask need to be CONTIGUOUS:

CIDR Notation

  • Replace classful IP Addressing
  • Variable Length Subnet Mask(VLSM)
    • Use 10.0.0.0/8 notation rather than 10.0.0.0
  • Vary Mask and allocate ip ranges dynamically instead of classful masks

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。