Data Communication and Networking

TCP/IP Model; Transport Layer — TCP vs UDP

C-CAT

TCP/IP Model

What is TCP/IP Model?

The TCP/IP Model (Internet Model) is the practical model used in real-world networking (the Internet).

Developed by DARPA for the ARPAnet (predecessor to the internet).

Comparison with OSI:

OSI Model (7 layers)         TCP/IP Model (4 layers)
-----------------------      -------------------------
7. Application               Application
6. Presentation           →  (merged into Application)
5. Session                   (merged into Application)
4. Transport                 Transport
3. Network                →  Internet
2. Data Link              →  Network Access (Link)
1. Physical                  (merged into Network Access)

TCP/IP Layers

LayerOSI EquivalentProtocols
ApplicationLayers 5, 6, 7HTTP, HTTPS, FTP, SMTP, DNS, DHCP, SSH
TransportLayer 4TCP, UDP
InternetLayer 3IP (IPv4/IPv6), ICMP, IGMP
Network AccessLayers 1, 2Ethernet, Wi-Fi, ARP

Key TCP/IP Protocols

ProtocolPortPurpose
HTTP80Web browsing
HTTPS443Secure web browsing
FTP20, 21File transfer
SFTP22Secure file transfer
SSH22Secure remote login
TELNET23Remote login (insecure)
SMTP25Send email
DNS53Domain name resolution
DHCP67, 68IP address assignment
POP3110Receive email (download)
IMAP143Receive email (server-side)
SNMP161Network device management

Transport Layer — TCP vs UDP

TCP — Transmission Control Protocol

TCP provides reliable, ordered, error-checked delivery of data between applications.

TCP Characteristics:

FeatureDescription
ConnectionConnection-oriented; 3-way handshake before data
ReliabilityGuaranteed delivery (ACK for every segment)
OrderSegments reassembled in order (sequence numbers)
Error controlRetransmission of lost segments
Flow controlSliding window prevents overwhelming receiver
Congestion controlAdjusts speed based on network congestion
OverheadHigh (more header fields)
Use caseWeb (HTTP), email, file transfer, SSH

TCP Three-Way Handshake

Client                    Server
  |                          |
  |──── SYN ────────────────>| (Client: I want to connect; seq=x)
  |                          |
  |<─── SYN-ACK ────────────| (Server: OK, I'm ready; seq=y, ack=x+1)
  |                          |
  |──── ACK ────────────────>| (Client: Got it; ack=y+1)
  |                          |
  | ← DATA TRANSFER BEGINS →|

Connection Termination (4-way):

Client → FIN → Server
Client ← ACK ← Server
Client ← FIN ← Server
Client → ACK → Server

UDP — User Datagram Protocol

UDP provides fast, connectionless, unreliable data transmission.

UDP Characteristics:

FeatureDescription
ConnectionConnectionless; no handshake
ReliabilityNo guarantee of delivery
OrderNo sequence numbers
Error controlNo retransmission
OverheadLow (small header)
SpeedMuch faster than TCP
Use caseVideo/audio streaming, DNS, gaming, VoIP

TCP vs UDP Comparison

FeatureTCPUDP
ConnectionConnection-orientedConnectionless
ReliabilityGuaranteed deliveryBest effort
OrderIn-order deliveryMay arrive out of order
SpeedSlowerFaster
Header20 bytes minimum8 bytes
OverheadHighLow
Flow controlYesNo
Congestion controlYesNo
UseHTTP, FTP, SSH, SMTPDNS, DHCP, video streaming, VoIP, gaming

Port Numbers

Port numbers identify specific applications/processes on a device.

Range:

RangeTypeDescription
0 – 1023Well-KnownReserved for standard protocols
1024 – 49151RegisteredAssigned to non-standard apps
49152 – 65535Dynamic/EphemeralTemporary client ports

Continue learning

Related notes

Put this topic into timed practice

Open mock tests when you want full-exam pacing, or keep drilling in practice mode.