Skip to the content ForoHackers
Log inJoin

TCP/IP: start here

TCP/IP
#3171 · · Quote · Report

TCP/IP is the pair of protocols that carries almost everything on the internet. IP moves individual packets between addresses with no promises; TCP, on top of it, turns that into a reliable, ordered stream between two programs. Understanding them explains most "the network is slow" mysteries.

Key concepts

  • IP addressing: IPv4 and IPv6 addresses, subnets, prefixes and the idea of a network versus a host.
  • Packets and fragmentation: IP delivers best effort; packets can be lost, duplicated, reordered or too big for a link (MTU).
  • TCP connection: a three-way handshake opens it; sequence numbers and acknowledgements make delivery reliable.
  • Flow and congestion control: the receiver's window and the sender's congestion window decide how fast data flows.
  • UDP: the other transport, with no connection and no guarantees, used when speed or control matters more.

Vocabulary

  • Port: a number that tells the host which program gets the data.
  • Socket: the programming interface to a connection, defined by addresses and ports.
  • NAT: rewriting addresses at a boundary so many hosts share one public address.
  • ICMP: the protocol of error and diagnostic messages, behind ping and traceroute.
  • RTT: round-trip time, the floor under every request.

What to study, in order

  1. Binary, subnets and CIDR notation: split a network by hand.
  2. Use ping, traceroute and ss or netstat on your own machines, and explain each output line.
  3. Capture a TCP handshake and a close in Wireshark and label every field.
  4. Write a TCP echo server and client with sockets; then the same with UDP.
  5. Study slow start, retransmission timers and congestion control, and reproduce loss on a lab link.

Related tags

#protocols #routing #dns #network-administration #protocol-analysis

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply