← Home
Technical Reference Manual

OSI vs TCP/IP
Deep Technical Guide

A comprehensive technical reference covering Ethernet fundamentals, OSI and TCP/IP layering, network topologies, IPv4/IPv6 addressing with subnetting, and routing protocols from static routes through BGP.

OSI 7-Layer TCP/IP 4-Layer CSMA/CD IPv4 · IPv6 BGP · OSPF · EIGRP
Section 01
Ethernet & CSMA/CD

Ethernet (IEEE 802.3) is the dominant Layer-2 LAN technology. Its original contention-based medium access method — Carrier Sense Multiple Access / Collision Detection — defines how stations share a shared coaxial or half-duplex segment.

CSMA/CD Algorithm
PSEUDO-CODE while frame_to_send: sense medium # carrier sense if idle >= 9.6 µs: # IFG (Inter-Frame Gap) begin transmitting while transmitting: detect collision # collision detect if collision: transmit JAM signal 32 bits increment attempt counter if counter > 16: abort # discard frame wait back-off(k) # truncated binary exp. goto sense frame sent OK else: defer and retry
Key Parameters
  • Slot Time512 bit-times = 51.2 µs @ 10 Mbps
  • Jam Signal32 bits — ensures all stations detect collision
  • Max Retries16 — then frame discarded, upper layer notified
  • Back-off formulaRandom ∈ [0, 2k−1] slot times, k = min(attempt, 10)
  • Min Frame Size64 bytes (to cover max collision domain)
  • Max Frame Size1518 bytes (standard) / 9000 bytes (jumbo)
  • IFG9.6 µs — mandatory idle time between frames
  • Collision DomainMax 2500 m / 4 repeaters (5-4-3 rule)
CSMA/CD is obsolete in modern switched networks. Full-duplex Ethernet (introduced with switches) eliminates collisions entirely — no carrier sense, no jam signal, no back-off. CSMA/CD only operates in half-duplex, shared-medium segments (hubs). 1 Gbps+ Ethernet uses point-to-point full-duplex exclusively.
Standard Speed Medium Max Distance CSMA/CD?
10BASE-T10 MbpsCat3/5 UTP100 mYes (half-duplex)
100BASE-TX100 MbpsCat5/5e UTP100 mYes (half-duplex)
1000BASE-T1 GbpsCat5e UTP100 mNo (full-duplex only)
1000BASE-SX1 GbpsMultimode fiber550 mNo
10GBASE-LR10 GbpsSinglemode fiber10 kmNo
100GBASE-SR4100 GbpsOM4 MMF100 mNo
Section 02
OSI Network Layers

The OSI Reference Model (ISO/IEC 7498-1) partitions network communication into 7 abstract layers. The TCP/IP model collapses these into 4 functional layers. Each OSI layer communicates with the layer directly above and below via service access points (SAPs).

OSI 7-Layer Model

7
Application
HTTP/S FTP SMTP DNS SNMP SSH
6
Presentation
TLS/SSL JPEG MPEG ASN.1 XDR
5
Session
NetBIOS RPC PPTP SOCKS
4
Transport
TCP UDP SCTP DCCP
3
Network
IPv4 IPv6 ICMP OSPF BGP
2
Data Link
Ethernet 802.11 ARP PPP VLAN STP
1
Physical
NIC Fiber RJ-45 RS-232 DSL

OSI ↔ TCP/IP Mapping

TCP/IP LayerOSI LayersPDU Name
Application L7 + L6 + L5 Data
Transport L4 Segment / Datagram
Internet L3 Packet
Network Access L2 + L1 Frame / Bits

Per-Layer Deep Detail

L1 — Physical Layer

Responsible for bit transmission: voltage levels, timing, modulation, encoding. Standards: RS-232, V.35, EIA/TIA-568. Devices: repeaters, hubs, cables, transceivers. Encoding schemes: NRZ, Manchester, 8B/10B, 64B/66B.

L2 — Data Link Layer

Framing, MAC addressing (48-bit), error detection (CRC-32), flow control. Split into LLC (IEEE 802.2) and MAC sub-layers. Devices: switches (L2), bridges. VLANs operate at L2 (IEEE 802.1Q tag: 4 bytes, 12-bit VLAN ID). STP (802.1D) prevents loops via root election and port roles.

ETHERNET FRAMEPreamble 7B │ SFD 1B │ Dst MAC 6B │ Src MAC 6B │ Type/Len 2B │ Payload 46–1500BFCS 4B │
L3 — Network Layer

Logical (IP) addressing, routing, packet fragmentation. IPv4 header: 20 bytes minimum. TTL prevents infinite loops. IP fragmentation based on MTU (default 1500 bytes Ethernet). ICMP provides control messages (type 0: echo reply, type 3: dest unreachable, type 11: TTL exceeded).

L4 — Transport Layer

TCP: connection-oriented, 3-way handshake (SYN→SYN-ACK→ACK), sliding window, congestion control (AIMD, slow start, CUBIC). Ports 1–1023 well-known, 1024–49151 registered, 49152–65535 ephemeral.

UDP: connectionless, 8-byte header, no ordering guarantee. Used for DNS, DHCP, VoIP, QUIC.

Section 03
Network Topologies

Network topology defines the arrangement of nodes and links. Physical topology describes cabling; logical topology describes data flow. The two most common WAN topologies in enterprise design are Hub-and-Spoke and Full Mesh.

Hub-and-Spoke (Star)

HUB S1 S2 S3 S4 S5 S6 Links = N−1 = 6
  • Links requiredN − 1
  • Traffic pathAll traffic traverses hub — single choke point
  • RedundancyNone without adding backup hub / DMVPN
  • ScalabilityHigh — add spokes without rewiring others
  • SPOFYes — hub failure = total outage
  • Use caseMPLS VPN, DMVPN Phase 1, branch WAN

Full Mesh

N1 N2 N3 N4 N5 N6 Links = N(N−1)/2 = 15
  • Links requiredN(N−1) / 2
  • Traffic pathDirect path between any pair — optimal latency
  • RedundancyMaximum — N−1 alternate paths per node
  • ScalabilityPoor — quadratic growth (10 nodes = 45 links)
  • SPOFNone
  • Use caseCore/backbone layer, DMVPN Phase 3, data centers
📐 Partial Mesh is the practical compromise: only critical nodes are fully interconnected. For example, in a 3-tier campus design, the core switches form a full mesh (2 nodes, 1 link), distribution switches connect to both core nodes (partial), and access switches connect only upward to distribution.
Section 04
IP Addressing — IPv4 / IPv6

IPv4 uses 32-bit addresses (4,294,967,296 total). Originally divided into classes (classful routing). Today, CIDR (Classless Inter-Domain Routing, RFC 4632) is universal. IPv6 uses 128-bit addresses, expressed in 8 groups of 4 hex digits.

IPv4 Address Classes

Class A · /8
0.0.0.0 – 127.255.255.255
Class B · /16
128.0 – 191.255
C · /24
192–223
D
Mcast
E
Exp.
ClassFirst BitsRange (1st Octet)Default MaskNetworksHosts/NetPurpose
A 0xxxxxxx 1 – 126 /8 (255.0.0.0) 126 16,777,214 Large corporations, ISPs
B 10xxxxxx 128 – 191 /16 (255.255.0.0) 16,384 65,534 Medium-large organizations
C 110xxxxx 192 – 223 /24 (255.255.255.0) 2,097,152 254 Small networks, branches
D 1110xxxx 224 – 239 N/A N/A N/A Multicast (OSPF: 224.0.0.5, PIM, etc.)
E 1111xxxx 240 – 255 N/A N/A N/A Reserved / Experimental

Private (RFC 1918) Address Space

RFC 1918 # Class A private range — 1 block 10.0.0.0/8 # 10.0.0.0 – 10.255.255.255 (16,777,216 addresses) # Class B private range — 16 blocks 172.16.0.0/12 # 172.16.0.0 – 172.31.255.255 (1,048,576 addresses) # Class C private range — 256 blocks 192.168.0.0/16 # 192.168.0.0 – 192.168.255.255 (65,536 addresses) # Special ranges 127.0.0.0/8 # Loopback 169.254.0.0/16 # APIPA (link-local, RFC 3927) 0.0.0.0/8 # "This network" (source only) 255.255.255.255 # Limited broadcast

IPv6 — 128-Bit Addressing

IPv6 addresses are 128 bits written as 8 groups of 4 hex nibbles separated by colons. Consecutive all-zero groups may be replaced with :: once per address.

2001Group 1
0db8Group 2
85a3Group 3
0000Group 4
0000Group 5
8a2eGroup 6
0370Group 7
7334Group 8
IPv6 Address Types
  • Unicast Global2000::/3
  • Link-Localfe80::/10 — auto-configured, non-routable
  • Loopback::1/128
  • Unspecified::/128 (0.0.0.0 equivalent)
  • Multicastff00::/8
  • Unique Localfc00::/7 (RFC 4193 — private)
  • AnycastFrom unicast space — assigned to multiple interfaces
IPv4 vs IPv6 Quick Compare
  • Address size32 bits → 128 bits
  • Header size20–60 bytes → 40 bytes (fixed)
  • FragmentationRouters + hosts → end hosts only
  • BroadcastYes → No (replaced by multicast/anycast)
  • ARPARP (RFC 826) → NDP / ICMPv6
  • DHCPDHCPv4 → DHCPv6 or SLAAC (RFC 4862)
  • IPSecOptional → Mandatory (RFC 6434)
  • ChecksumYes → Removed (L2/L4 handle it)
Section 04b
Subnetting

Subnetting borrows bits from the host portion of an address to create multiple smaller networks. CIDR notation expresses the prefix length (number of network bits). Hosts per subnet = 2h − 2 where h = host bits.

CIDR Reference Table — Class C (/24 base)

CIDRSubnet MaskSubnets from /24Host BitsUsable HostsBlock Size
/24255.255.255.018254256
/25255.255.255.12827126128
/26255.255.255.192466264
/27255.255.255.224853032
/28255.255.255.2401641416
/29255.255.255.24832368
/30255.255.255.25264224
/31255.255.255.25412812 (p2p)2
/32255.255.255.25525601 (host)1

Subnet Quick Calculator

IP Address
Prefix (CIDR)
Section 04c
Subnetting Exercises
Exercise 1 — Network & Broadcast from 172.16.45.14/20

Find: Network address, broadcast address, first/last usable host, and the number of usable hosts.

▶ Show Solution
/20 = 20 network bits, 12 host bits in the last two octets.
Mask = 255.255.240.0. Block size on 3rd octet = 256−240 = 16.
3rd octet 45 → floor(45/16)×16 = 32. So network = 172.16.32.0/20.
Broadcast = 172.16.47.255 (32+16−1 = 47, last octet all 1s).
First host = 172.16.32.1 · Last host = 172.16.47.254
Usable hosts = 212 − 2 = 4,094
Exercise 2 — VLSM for 4 departments

Allocate from 10.1.0.0/16: Engineering=500 hosts, Sales=200 hosts, HR=50 hosts, Management=10 hosts. Minimize waste.

▶ Show Solution
Engineering 500 hosts → need 210=1024 → /22 (1022 usable) → 10.1.0.0/22 (10.1.0.1–10.1.3.254)
Sales 200 hosts → need 28=256 → /24 (254 usable) → 10.1.4.0/24
HR 50 hosts → need 26=64 → /26 (62 usable) → 10.1.5.0/26
Management 10 hosts → need 24=16 → /28 (14 usable) → 10.1.5.64/28
Always allocate largest subnet first to avoid fragmentation.
Exercise 3 — Supernetting / Route Summarization

Summarize: 192.168.16.0/24, 192.168.17.0/24, 192.168.18.0/24, 192.168.19.0/24 into a single advertisement.

▶ Show Solution
Convert 3rd octets to binary:
16 = 0001 0000
17 = 0001 0001
18 = 0001 0010
19 = 0001 0011
Common prefix: first 6 bits = 000100xx → /22
Summary = 192.168.16.0/22 (covers .16.0–.19.255)
Section 05
Routing

Routing is the process of selecting paths in a network. The router's forwarding decision is based on the Routing Information Base (RIB) — the best entry per prefix is installed in the Forwarding Information Base (FIB). Best path is determined by prefix length (longest match), then Administrative Distance, then metric.

Administrative Distance (AD)

AD is Cisco's trustworthiness value for a routing source. Lower = more trusted. Used to select between routes from different sources to the same prefix.

SourceADTrustworthiness
Connected interface 0
Static route 1
eBGP 20
EIGRP (internal) 90
OSPF 110
IS-IS 115
RIP 120
EIGRP (external) 170
iBGP 200
Unknown / Unreachable 255

Static Routing

CISCO IOS # Standard static route ip route 192.168.20.0 255.255.255.0 10.0.0.2 # Static route via exit interface (proxy ARP concern on Ethernet) ip route 192.168.20.0 255.255.255.0 GigabitEthernet0/1 # Floating static (backup) — AD 254 > OSPF 110, used only if OSPF fails ip route 0.0.0.0 0.0.0.0 203.0.113.1 254 # Default route ip route 0.0.0.0 0.0.0.0 10.0.0.1 # Null route (black-hole) ip route 192.168.99.0 255.255.255.0 Null0

Dynamic Routing Protocols

IGP (Interior Gateway Protocol) — operates within a single Autonomous System (AS). Exchanges topology / reachability information between routers under the same administrative domain. AS is identified by a 16-bit or 32-bit number.
EGP (Exterior Gateway Protocol) — operates between Autonomous Systems. BGP is the only EGP in production use and is the routing protocol of the entire Internet.
IGP · Distance Vector
RIP
Routing Information Protocol (v1/v2/ng)
  • AlgorithmBellman-Ford
  • MetricHop count (max 15; 16 = ∞)
  • UpdatesPeriodic full table, 30 sec
  • ConvergenceSlow (minutes)
  • AD120
  • TransportUDP/520 (v2), UDP/521 (ng)
RIPv2: multicast 224.0.0.9 RIPng: IPv6 Split-horizon Route poisoning
IGP · Link State
OSPF
Open Shortest Path First (v2/v3 — RFC 2328/5340)
  • AlgorithmDijkstra SPF
  • MetricCost = 10⁸/BW (Cisco default)
  • UpdatesTriggered LSA flooding; LSRefresh 30 min
  • ConvergenceFast (seconds)
  • AD110 (internal) / 110 (external type 1&2)
  • AreasHierarchical — Area 0 backbone mandatory
DR/BDR election Hello: 224.0.0.5 LSA types 1–7 LSDB per area OSPFv3: IPv6
IGP · Advanced DV
EIGRP
Enhanced Interior Gateway Routing Protocol (RFC 7868)
  • AlgorithmDUAL (Diffusing Update)
  • MetricComposite: BW + delay (+ reliability, load, MTU)
  • UpdatesPartial, bounded, reliable (RTP)
  • ConvergenceVery fast — pre-computed feasible successors
  • AD90 (internal) / 170 (external)
  • VLSMYes; supports IPv4 & IPv6 (named mode)
Feasible distance Reported distance Multicast 224.0.0.10 Unequal load-balancing
IGP · Link State
IS-IS
Intermediate System to Intermediate System (ISO 10589)
  • AlgorithmDijkstra SPF
  • MetricDefault: 10 per interface (narrow); wide metrics: 32-bit
  • TransportDirectly over L2 (not IP) — protocol 0xFEFE
  • LevelsL1 (intra-area), L2 (backbone), L1/L2
  • AD115
  • UseISP backbone, large-scale SP networks
CLNP addressing (NET) Multi-topology IPv6 native Sub-TLV extensions
EGP · Path Vector
BGP-4
Border Gateway Protocol v4 (RFC 4271) — The Internet's routing protocol
  • Session typeeBGP (between AS), iBGP (within AS)
  • TransportTCP/179 — reliable, ordered delivery
  • ConvergenceSlow — policy-driven, not speed-optimized
  • Metric / Selection14-step best path algorithm (Weight → LOCAL_PREF → AS_PATH → ORIGIN → MED → …)
  • AD (eBGP)20
  • AD (iBGP)200
AS_PATH loop prevention Communities RFC 1997 Route Reflectors Confederations MP-BGP RFC 4760 EVPN RFC 7432
IGP · Legacy DV
IGRP
Interior Gateway Routing Protocol (Cisco proprietary — EOL)
  • AlgorithmBellman-Ford (enhanced)
  • MetricBW + delay + reliability + load
  • Max hops255
  • AD100
  • StatusDeprecated — replaced by EIGRP
Cisco proprietary Classful only Removed in IOS 12.3

BGP Best-Path Selection (Cisco Implementation)

BGP ALGORITHM — 14 STEPS 1. Next-hop reachable # Skip if NEXT_HOP is unreachable 2. Weight (highest) # Cisco-proprietary, local to router 3. LOCAL_PREF (highest) # iBGP-wide preference 4. Locally originated # network/redistribute/aggregate 5. AS_PATH length (shortest) # Fewer AS hops preferred 6. ORIGIN code (IGP < EGP < ?) # i > e > ? 7. MED (lowest) # Multi-Exit Discriminator — compared within same AS 8. eBGP over iBGP path 9. IGP metric to next-hop (lowest) 10. Oldest eBGP path (stability) 11. Lowest BGP router-ID # tie-break 12. Shortest cluster-list 13. Lowest neighbor IP address

OSPF Area Types & LSA Reference

LSA TypeNameOriginated ByFlooded ToContents
Type 1Router LSAEvery routerWithin areaAll links, state, cost
Type 2Network LSADR on broadcastWithin areaAttached routers on segment
Type 3Summary LSAABRInto area from backboneInter-area routes
Type 4ASBR SummaryABRInto non-backbone areasPath to ASBR
Type 5AS External LSAASBRAll areas (except stub)External routes (E1/E2)
Type 7NSSA ExternalASBR in NSSAWithin NSSA onlyConverted to Type 5 at ABR
OSI / TCP-IP Technical Reference
IEEE 802.3 · RFC 791 · RFC 2328 · RFC 4271 · RFC 7868 · RFC 4632
Advanced Mode
Switch version
☀️
Switch to Simple Guide