Networking refresher

Intermediate Docker

Mike Metzger

Data Engineering Consultant

What is networking?

  • A computer network consists of systems communicating via a defined method
  • Varying levels of communication, physical or logical, referred to as protocols
  • Common physical networks include Ethernet and WiFi
  • Logical networking includes TCP/IP, HTTP, and SMTP
  • Networks are defined in various layers or levels. Often referred to as a networking stack

Computer networking hardware

1 Photo by Jordan Harrison on Unsplash.
Intermediate Docker

Networking terms

  • Host
    • General term for a computer
  • Network
    • Group of hosts
  • Interface
    • Actual connection from a host to a network, such as Ethernet or WiFi
    • Can be virtual, meaning entirely in software
  • LAN
    • Local Area Network, or set of computers at a given location
  • VLAN
    • Virtual LAN, or a software LAN
Intermediate Docker

Internet Protocol

  • IP
    • Internet protocol, method to connect between networks using IP addresses
  • IPv4
    • Version of IP supporting 4.2 billion addresses, currently exhausted
  • IPv6
    • Newer version of IP, supporting 2^128 addresses, still being deployed
IPv4: 10.10.10.1

IPv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Intermediate Docker

TCP / UDP

  • TCP
    • Transmission Control Protocol, used to reliably communicate between hosts on IP networks
  • UDP
    • User Datagram Protocol, used to communicate between hosts on IP where communication is not required.
Intermediate Docker

Ports

  • Port
    • Addresses services on a given host, a value between 0 and 65535, used to communicate between hosts via TCP or UDP
    • Ports below 1024 are typically reserved for privileged accounts
    • Values above 1024 are usually ephemeral or temporary ports
    • Applications listen on a port.
Intermediate Docker

Application protocols

  • HTTP/HTTPS
    • Application protocol, defaulting to TCP port 80 for web communication. Secure version on TCP 443
  • SMTP
    • Email transfer protocol, over TCP port 25
  • SNMP
    • Network management protocol, over UDP port 161
Intermediate Docker

Docker and networking

  • Can communicate between containers
  • Can communicate with the host system
  • Depending on settings can communicate with external hosts
  • Typical communication is handled by exposing ports from container to host
  • Acts like a translation between containers and hosts
Intermediate Docker

Docker and IP

  • Containers can have IP addresses
  • Use ifconfig <interface> or ip addr show <interface> from within container to find addresses
  • Use ping -c <x> <host> to verify connectivity
    • ping -c 3 myhost

ifconfig

Intermediate Docker

Let's practice!

Intermediate Docker

Preparing Video For Download...