3. OSI Model, TCP/IP Model, TCP vs UDP and the 3-Way Handshake
3.3 The TCP/IP Model and OSI Comparison
OSI hi aapli "bolnyachi bhasha" aahe, pan internet pratyakshat TCP/IP model var chalto. Donhi cha mapping lakshat theva – interview madhe "OSI vs TCP/IP" ha prashna khup common aahe.
OSI Model TCP/IP Model
+---------------------+ +----------------------+
| 7 Application | | |
| 6 Presentation | ---> | Application | HTTP, DNS, SSH, TLS
| 5 Session | | |
+---------------------+ +----------------------+
| 4 Transport | ---> | Transport | TCP, UDP
+---------------------+ +----------------------+
| 3 Network | ---> | Internet | IP, ICMP, ARP
+---------------------+ +----------------------+
| 2 Data Link | ---> | Network Access | Ethernet, Wi-Fi
| 1 Physical | | (Link) |
+---------------------+ +----------------------+
| Point | OSI model | TCP/IP model |
|---|---|---|
| Layers | 7 | 4 (or 5) |
| Developed by | ISO (reference/theoretical) | US DoD / DARPA (practical) |
| Approach | Model first, protocols later | Protocols first, model later |
| Session & presentation | Separate layers | Merged into Application |
| Usage | Teaching, troubleshooting vocabulary | Actual internet implementation |
| Transport layer | Connection-oriented and connectionless | TCP (connection) and UDP (connectionless) |
| Where AWS services sit (useful for cloud security): |
| Layer | AWS example |
|---|---|
| L7 | Application Load Balancer (routes by URL/host), CloudFront, AWS WAF, Route 53 (DNS) |
| L4 | Network Load Balancer, Security Groups (filter by protocol + port + IP) |
| L3 | VPC, subnets, route tables, Internet/NAT gateways, Network ACLs |
| L1–L2 | Managed by AWS (physical data centres, Nitro hardware, ENIs) |
Why this matters for security
Security groups filter at L3/L4 (IP, protocol, port) – they cannot see an SQL injection inside an allowed HTTPS request. AWS WAF works at L7 and can. That is why a real design uses both: security groups to close doors, a WAF and secure code to inspect what walks through the open door. Always choose a control by the layer of the attack: an L7 attack needs an L7 defence.
Ravindra Bagale's Tip
Students TCP/IP model la "5 layers" ki "4 layers" ya var vaad ghaltat. Dogha uttar chalatat – fakt mapping clear sanga: Application (OSI 5–7), Transport (4), Internet (3), Network Access (1–2). Aani "security group aahe na, mag SQL injection pan block hoil" asa kadhi mhanu naka – security group request madhla data baghat nahi. Interviewer la tumcha logic aikaycha asto, ratlela number nahi.
Practice task
Place each of these in both models: HTTPS, TLS, TCP, IP, ICMP ping, ARP, Ethernet switch, Wi-Fi, DNS, SSH, Nginx, security group, Network ACL, AWS WAF.