Networking Fundamentals

(Kalyana+Soma).Sundaram
Lead DevOps Engineer, Media.net

What happens when you open www.google.com

 

AGENDA

  • DNS, UDP (0.5 days)
  • HTTP/(S) (0.5 days)
  • TCP, IP Routing (0.5 days)
  • Conclusion and Noc session(0.5 days)

DNS

  1. why DNS
    IP vs Domain Name
  2. StakeHolders
    TLD owners- ccTLD,gTLD etc
    Registrars-  Godaddy, Orderbox
    DNS Cache- ISP, local

Nameserver

  • Assume we registered google.com domain.
  • Most domain registrars have their own ns
  • NS makes authoritative response to google.com
  • Glue Records

 

Activity

  • install bind9
  • out of box recursion is on
  • tld
  • resolv.conf

Activity

  • set zone example.google.com 

Types of Records

  1. A record
  2. PTR record  dig -x 8.8.8.8 @8.8.8.8
  3. CNAME
  4. NS
  5. SPF DKIM

Where else dns can be used?

  1.    To geographically distribute traffic
  2.     Load balancing
  3.     Both a and b
  4.     none

END Notes

  1. TTL
  2. Setup custom backend in powerdns
    https://doc.powerdns.com/md/authoritative/backend-pipe/
  3. DM DNS Overview

UDP

  • DNS uses UDP
  • Just multiplexing, fire and forget
  • Source Port Destination Port
  • tcpdump
    tcpdump -s 0 -A -i any net 8.8.8.8 -nn

Sysctl tunables

HTTP

  1. Methods
    Get,Head,Post,Put..
  2. HTTP/1.1 vs HTTP/1.0
    telnet directi.com 80
  3. Headers

HTTP States

  • Stateless
  • Cookie
  • Web Proxy (cache headers)
  • Man in the middle
    tcpdump

HTTPS

TLS

End to End Encryption

Activity

  1. Install apache2
  2. Setup Self Signed Cert and https

TCP

  • 3 way handshake
  • Acknowledgements and reliability
  • tcpdump and check sequence numbers
  • Push Reset Flags

sysctl values

  • tcp_rmem,tcp_wmem
  • tcp_max_syn_backlog
  • tcp_recycle,tcp_fintimeout
    Connection Tearing Phase

What if somebody spoofs Syn and send to me?

  1.      Syn+Ack goes to spoofed ip
  2.      Syn+Ack goes to correct ip
  3.      Syn+Ack is dropped
  4.      Hodor

 

 

TCP Attacks

  • SYN/ACK flood
  • SYN Cookies, somaxconn, tcp_syn_backlog

Network + Data Link Layer

  • Routing table
    route -n
  • CIDR subnet mask
    mask XOR IP=net
  • Gateway 0.0.0.0 ARP
  • Net 0.0.0.0
  • rp_filter(way to prevent spoofed ip)

Network + Data Link Layer

Q From your system to Access point what part of the packet addresses the access point when you open google.com?

  1.       Source IP Address
  2.       Dest IP Address
  3.       Dest Port
  4.       Mac Address

 

NAT

Can the NAT box see HTTPS Application Level Data?

  1. Yes
  2. No

Recap opening www.google.com

Advanced

  • BGP
    looking glass lg.he.net
  • Tunnels
  • Anycast
  • CDN
  • Load Balancing
  • Mitigation
     

 

Copy of Networking Fundamentals

By Kalyana Sundaram

Copy of Networking Fundamentals

  • 502