Section 6: The OSI Network Layer

  Uncategorized

< Section 5 | Home | Section 7 >

12% Complete

26: Introduction

27: The IP header

https://www.udemy.com/cisco-icnd1/learn/lecture/8589462#overview

The Network Layer

  • The network Layer is responsible for routing packets to their destination and for QoS Quality of Service.
  • IP (Internet Protocol) is the best known Layer 3 protocol.  IPv4 is the focus of this section
  • It is a connectionless protocol with no acknowledgements at Layer 3
    • This is controlled at Layer 4
  • Other Layer 3 Protocols include ICMP (Internet Control Message Protocol) and IPSec.

IP Addressing

  • IP addressing is a logical addressing scheme which is implemented at Layer 3.
  • Network designers use IP addressing to partition the  overall network into smaller ‘Subnets’
  • This improves performance and security and makes troubleshooting easier.
  • Layer 2 MAC addresses use one big flat addressing scheme.  There is no logical separation between networks at Layer 2.  It’s done at Layer 3.

Layer 3 Encapsulation

Overview

 The IP Header (IPv4)

  • IP version type
  • Size of Layer 3 header
  • Type of service = QoS
  • Total packet size
  • ID used for fragment information for different media types
    • Includes the flags and fragment offset
  • TTL
    • Every time a packet hits a router, that router will decrement this value by one.  Once a packet’s TTL reaches 0, that router will drop the packet.
    • This helps prevent packet loops from getting lost forever and never reaching their destination
    • 8 bit protocol specifies the type of protocol (TCP, UDP, etc.)
    • Checksum validates the packet has not been corrupted during transport.
    • Source and Destination IPs (32 bits each)
    • Header Options – Not commonly used
    • Any remaining data for the packet.

28: Unicast. Broadcast and Multicast

https://www.udemy.com/cisco-icnd1/learn/lecture/8589466#content

Three main types of IP traffic

  • Unicast:Goes to a single destination host
  • Broadcast: Goes to all hosts on the subnet
    • You get it if you want it or not
  • Multicast: Sent to multiple hosts interested in the traffic
    • With Unicast and 3 destination hosts, a 1MB packet would be sent 3x, so 3MB total
    • With Multicast, you only send 1MB but all interested hosts will receive it.
      • Think of listeners tuning into a radio station.

29: How to Count in Binary

https://www.udemy.com/cisco-icnd1/learn/lecture/8589468#content

128 64 32 16 8 4 2 1

236 = 11101100

30: IPv4 Addressing

https://www.udemy.com/cisco-icnd1/learn/lecture/8589476#content

IPv4 Address

  • 32 total bits
  • Each ‘octet’ (8 bits) is separated with a .
    • Each octet can be between 0 – 255
  • To see your IP address
    • Windows: ipconfig
      • also shows the default gateway and subnet mask
    • Linux/Mac: ifconfig
      • show IP and subnet mask
      • Default Gateway: ip route
    • IOS
      • IP address: show ip interface breif
      • subnet mask: show interface
        • CIDR notation

Static and Automatic addressing

  • IP addresses are usually setup manually on servers, printers and network devices such as routers and switches.
  • It is often setup automatically on PCs and Laptops using DHCP (Dynamic Host Configuration Protocol)

31: Calculating an IPv4 Address in Binary

https://www.udemy.com/cisco-icnd1/learn/lecture/8589478#content

IPv4 Octets

  • Octets range from 0 – 255
  • Convert 192.168.10.15

you get the picture

32: The Subnet Mask

https://www.udemy.com/cisco-icnd1/learn/lecture/8589482?start=0#overview

Quick Count

  • 1000 0000 = 128
  • 1100 0000 = 192
  • 1110 0000 = 224
  • 1111 0000 = 140
  • 1111 1000 = 148
  • 1111 1100 = 252
  • 1111 1110 = 254
  • 1111 1111 = 255

Subnet Masks

  • A host can send traffic to another host on the same subnet via switches
  • For a host to send traffic to another host in a different subnet, it must be forwarded by a router
    • Routers link different subnets together
  • The host therefore needs to understand if the destination is on the same or a different subnet in order to know how to send it.
    • This is the purpose for the subnet mask
  • Subnet mask is also 32 bits long and can be written in dotted decimal or slash (CIDR) notation.

Network and Host Portions of an IP

  • A Hosts IP is divided into a network portion and a host portion
  • The subnet mask defins where the boundary is
    • Let’s say the Host’s IP isd 192.168.10.15 and the subnet mask is 255.255.255.0

  • The IP address is compared to the subnet mask.
  • A ‘1’ in the subnet mask means that bit in the IP address is part of the Network address
  • A ‘0’ in the subnet mask indicates that bit is part of the Host address
  • In this example:
    • The network address is 192.168.10.0
    • The host address is .15

Local Subnet or Routed Traffic

  • if the host wants to communicate with another host with an IP address that also begins with 192.168.10. (for example, 192.168.10.20), it knows it’s on the same subnet and can send the traffic directly
  • if the host wants to communicate with another host with any other address (for example, 192.168.11.20, different subnet), it knows it must send the traffic via a router.
  • For a destination address to be in the same subnet, the network portion has to be exactly 192.168.10
  • Otherwise it’s in a different subnet and the traffic must be sent via a router.

Valid Subnet Masks

  • The subnet mask always begins with contiguous ‘1’s
  • For example:
    • 11111111.11111000.00000000.00000000 is a legal subnet mask
    • 10101010.01010101.00000000.00000000 is not

The Host Portion

  • The host portion of the address is availabel to be allocated to the different hosts on the subnet.  (PCs, Servers, Printers, Router Interfaces, etc.
  • There are 2 exceptions to this rule:  See Reserved Host IPs below
  • The host portion of the address specifies the individual host and must be unique on that subnet
  • Hosts DO NOT need to be numbered sequentially
    • On subnet 10.10.10.10 you can have a host with 10.10.10.10 and a host with 10.10.10.20
  • You cannot have two hosts with the same IP!
  • You can have different hosts the same Host ID as long as they are on different subnets
    • 10.10.10.10
    • 10.10.11.10
    • 10.10.20.10

Reserved Host IPs

  • All ‘0’s in the host portion designates the Network Address and is not allowed to be allocated to a host
    • In our example, the network address is 192.168.10.0
  • All ‘1’s designates the directed BROADCAST address for the subnet.
  • Traffic with this destination address will be sent to all hosts in the subnet
    • In our example, the broadcast address is 192.168.10.255
  • This leaves 192.168.10.1 – 192.168.10.254 for available Host IPs

33: Slash (CIDR) Notation

https://www.udemy.com/cisco-icnd1/learn/lecture/8589484#overview

  • Because the subnet mask must always begin with contiguous ‘1’s, it will be 1 to 32 bits long counting from the left to right
  • This allows us to write the subnet mask in slash notation which is more convenient than dotted decimal for network diagrams or in conversation.

  • 255.255.255.0 = 24 bits required to create the subnet mask.  This can now be displayed by yhr number of bits, or /24
  • So the IP and the subnet mask will be 192.168.10.15/24
  • The Network Addresss is 192.168.10.0/24

Example #2

  • This can be written as either:
    • 10.10.10.15 255.0.0.0
    • 10.10.10.15/8
  • The Network address is 10.0.0.0/8

 

 

 

 

 

 

F

LEAVE A COMMENT