breakfixlearn.com

NET-01Networking

OSI & TCP/IP models

Use this when: you troubleshoot layer by layer, or need to place a protocol, device or attack at its layer.

NET-01 OSI & TCP/IP models cheat sheet. Every table on it is repeated as text below.
Tap the sheet for the full-size image. The text version below is screen-reader friendly.

Text version

Everything on the sheet, as plain HTML: handy for screen readers, copy-paste and search.

7 OSI layers and 4 TCP/IP layers

The sender works down from layer 7 to layer 1; the receiver works back up from 1 to 7.

TCP/IP#OSI layerWhat it doesPDUKey protocolsDevice and address
Application (L5 to L7)7ApplicationNetwork services for appsDataHTTP(S), DNS, DHCP, SSHHost, server, NGFW
6PresentationFormat, encrypt, compressDataTLS*, UTF-8, JPEGEndpoint
5SessionOpen and close sessionsDataRPC, NetBIOSEndpoint
Transport4TransportEnd-to-end delivery, portsSegmentTCP, UDPFirewall, port
Internet3NetworkRouting between networksPacketIPv4, IPv6, ICMP, OSPFRouter, IP address
Link (L1 to L2)2Data LinkFrames, MAC, error checkFrameEthernet, Wi-Fi, ARP*Switch, AP, MAC address
1PhysicalSignals: voltage, light, radioBits1000BASE-T, fiber, PoECable, hub, NIC

Encapsulation

On the way down, each layer wraps the one above it. On the way up, the receiver strips each header in reverse.

PDULayerWhat it carries
DataL7 to L5Application data
SegmentL4Ports + data
PacketL3IP addresses + L4 header + data
FrameL2MAC addresses + L3 + L4 + data + FCS trailer
BitsL1The frame as a signal, for example 1011 0010 0110 1101

TCP vs UDP (layer 4)

TCPUDP
SetupSYN, SYN-ACK, ACKNone
DeliveryACKs, retransmit, windowingBest effort
Header20 bytes minimum8 bytes
Used byHTTPS 443, SSH 22DNS 53*, DHCP 67/68

Troubleshoot bottom-up

Cisco IOS and Windows commands, in the order you would run them.

LayerCommandWhat it answers
1show interfaces statusErrors, duplex
1shutdown then no shutdown cautionBounce the port
2show mac address-tableWhich port and VLAN?
3show ip interface briefUp/up? Right IP?
3ping, traceroute, tracertWhere does the path break?
4Test-NetConnection 192.0.2.10 -Port 443Is the port open?
7nslookup example.comDoes the name resolve?

Caution. shutdown drops every session on that port. Never bounce the link you are managing the device from.

Attacks and defenses by layer

LayerAttackDefense
7Phishing, SQL injectionEmail filter, WAF
4SYN flood, port scansSYN cookies, firewall
3IP spoofingACLs, uRPF
2ARP spoofingDynamic ARP Inspection
2MAC flooding, rogue DHCPPort security, DHCP snooping
1Rogue device on a wall jack802.1X, shut unused ports

Authorized use only. Test attacks only in your own lab or with written permission.

Remember

  • L1 to L7: Please Do Not Throw Sausage Pizza Away
  • L7 to L1: All People Seem To Need Data Processing
  • PDUs: Data, Segment, Packet, Frame, Bits
  • Switch = L2 (MAC). Router = L3 (IP).
  • UDP's layer 4 PDU is a datagram. DNS also uses TCP 53 (zone transfers and large answers).
  • * ARP sits between L2 and L3; TLS is often placed at L6.

Sources

Go deeper on the blog