10/7/2019 - 10:05 PM

TCP/IP For Developers

TCP/IP For Developers

Basic request Make a request for a page via switch and router DNS Server tells clients what IP address that page is hosted at Client requests page at IP address Content is served

DHCP Local DHCP server allocates an IP address to a machine

Each machine on the network has: IP address Subnet mask Default Gateway DNS Servers

Subnet mask: defines which part of the IP address is the subnet and which part is the specific node

If the IP address is not part of the subnet then it has to go through the default Gateway

DNS Server converts names to IP address

V4 vs V6 IPv4 - There are 2^32 total addresses Nearly at the limit

IPv6 - 2^128 More addresses than we’ll ever need

As a developer if capturing IP addresses, consider capturing IPv6 format

DNS When making a request to the name server, if requesting domain name, the DNS server will first check the Root NS then the .Info NS NS will respond to the DNS server with the IP address which is passed back to the client

DNS records are cached

Hosts file You can override DNS settings in this file, associating IP addresses with domains

Can be useful when moving domain names, can route traffic to new domain

Record types A record: routes domain name to an IP address NS record: the name servers for a domain MX record: mail exchange - the domain of the mail server for that domain CName: alias of the domain AAAA: IPv6 version of a domain name

Wilcards Requesting a non existing subdomain will return the localhost address so it can be used by developers

DNS Trace Shows the history of the DNS server retrieving the IP address for a domain name

IP Routing Subnets are groups of computers or IPs

A router routes traffic between subnets

Trace route allows you to watch the trace from your machine to an IP address

Subnets Subnet is defined by the combination of an IP address and a subnet mask, it defines a range of IP addresses

If a machine in that range tries to access a machine within the same subnet it can access it directly, otherwise it has to go via the default gateway

Subnet examples Is the same as 11111111.11111111.11111111.00000000** ** / 24 OR / OR - / 16 OR / OR - / 23 OR / OR -

NAT ISP gives one IP address, each local device is given a local IP using Network Address Translation (NAT)

TCP Transmission Control Protocol

Sends data from one machine to another, the receiving machine reports which packets have been received

If packets go missing, after a timeout it the sending machine will resend the lost packet

UDP User Datagram Protocol

The sending computer sends data without checking if it went missing

This is useful for things like sending live video, where we don’t care if something goes missing

Telnet This is a program that allows you to HTTP requests by specifying a domain and a port and sending an HTTP request

Port scan NMap is a free tool that allows you to port scan a server

It shows you which ports and protocols are available