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 argue about whether the TCP/IP model has "5 layers" or "4 layers". Both answers are fine – just explain the mapping clearly: Application (OSI 5–7), Transport (4), Internet (3), Network Access (1–2). And never say "there's a security group, so SQL injection will be blocked too" – a security group doesn't look at the data inside a request. The interviewer wants to hear your logic, not a memorised number.
Ravindra Bagale's Tip – मराठी
TCP/IP model "5 layers" की "4 layers" यावर students वाद घालतात. दोन्ही उत्तरं चालतात – फक्त mapping स्पष्ट सांगा: Application (OSI 5–7), Transport (4), Internet (3), Network Access (1–2). आणि "security group आहे ना, मग SQL injection पण block होईल" असं कधी म्हणू नका – security group request मधला data बघत नाही. Interviewer ला तुमचं logic ऐकायचं असतं, पाठ केलेला number नाही.
Ravindra Bagale's Tip – हिंदी
TCP/IP model में "5 layers" हैं या "4 layers", इस पर students बहस करते हैं. दोनों जवाब चलते हैं – बस mapping साफ़ बताओ: Application (OSI 5–7), Transport (4), Internet (3), Network Access (1–2). और कभी मत कहना "security group है न, तो SQL injection भी block हो जाएगा" – security group request के अंदर का data नहीं देखता. Interviewer तुम्हारा logic सुनना चाहता है, रटा हुआ number नहीं.
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.